Skip to content
Snippets Groups Projects
Unverified Commit ac0c36ec authored by Timo Furrer's avatar Timo Furrer
Browse files

Rename image registry base variable

parent d6f187c8
Branches
Tags
No related merge requests found
all: docs backports
.PHONY: docs
docs:
csplit -sf readme -n 1 .gitlab/README.md '/<INPUTS>/'
echo '<!-- This document is generated by `make docs` from `.gitlab/README.md` -->' > README.md
......@@ -23,6 +26,7 @@ BACKPORTS_BASE_FILE := $(BACKPORTS_BASE_DIR)/Base.gitlab-ci.yml
# Install it with `brew install gnu-sed` and follow the instructions in `brew info gnu-sed` to
# make it the standard `sed` binary (if you wish) or temporarily alias sed=gsed
backports:
@echo "Generating $(BACKPORTS_BASE_FILE) ..."
@mkdir -p $(BACKPORTS_BASE_DIR)
@cp $(BACKPORTS_DIR)/.Base.gitlab-ci.yml $(BACKPORTS_BASE_FILE)
@sed '1,/^---$$/d' templates/full-pipeline.yml >> $(BACKPORTS_BASE_FILE)
......@@ -30,7 +34,7 @@ backports:
@sed -i $(BACKPORTS_BASE_FILE) -e 's/$$\[\[ inputs.stage_build \]\]/build/'
@sed -i $(BACKPORTS_BASE_FILE) -e 's/$$\[\[ inputs.stage_deploy \]\]/deploy/'
@sed -i $(BACKPORTS_BASE_FILE) -e 's/$$\[\[ inputs.stage_cleanup \]\]/cleanup/'
@sed -i $(BACKPORTS_BASE_FILE) -e 's/$$\[\[ inputs._image_registry_base \]\]/$$GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE/'
@sed -i $(BACKPORTS_BASE_FILE) -e 's/$$\[\[ inputs.image_registry_base \]\]/$$GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE/'
@sed -i $(BACKPORTS_BASE_FILE) -e 's/$$\[\[ inputs.version \]\]/$$GITLAB_OPENTOFU_VERSION/'
@sed -i $(BACKPORTS_BASE_FILE) -e 's/$$\[\[ inputs.opentofu_version \]\]/$$OPENTOFU_VERSION/'
@sed -i $(BACKPORTS_BASE_FILE) -e 's/$$\[\[ inputs.root_dir \]\]/$$TF_ROOT/'
......@@ -47,3 +51,4 @@ backports:
@sed -i $(BACKPORTS_BASE_FILE) -e 's/destroy:/.opentofu:destroy:/'
@sed -i $(BACKPORTS_BASE_FILE) -e '/needs: \[destroy\]/d'
@sed -i $(BACKPORTS_BASE_FILE) -e 's/^delete-state:$$/.opentofu:delete-state:/'
@echo "Generated $(BACKPORTS_BASE_FILE)"
......@@ -18,7 +18,7 @@ variables:
# Compatible OpenTofu version, see https://gitlab.com/components/opentofu/-/releases
OPENTOFU_VERSION: "1.6.0"
# Job Image with `gitlab-tofu`
GITLAB_OPENTOFU_IMAGE: registry.gitlab.com/components/opentofu/gitlab-opentofu:$VERSION-opentofu$OPENTOFU_VERSION
GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE: $CI_REGISTRY/components/opentofu
# The relative path to the root directory of the OpenTofu project
TF_ROOT: ${CI_PROJECT_DIR}
# The name of the state file used by the GitLab Managed Terraform state backend
......
......@@ -18,7 +18,7 @@ variables:
# Compatible OpenTofu version, see https://gitlab.com/components/opentofu/-/releases
OPENTOFU_VERSION: "1.6.0"
# Job Image with `gitlab-tofu`
GITLAB_OPENTOFU_IMAGE: registry.gitlab.com/components/opentofu/gitlab-opentofu:$VERSION-opentofu$OPENTOFU_VERSION
GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE: $CI_REGISTRY/components/opentofu
# The relative path to the root directory of the OpenTofu project
TF_ROOT: ${CI_PROJECT_DIR}
# The name of the state file used by the GitLab Managed Terraform state backend
......
......@@ -30,7 +30,7 @@ spec:
description: 'OpenTofu version that should be used.'
# Images
_image_registry_base:
image_registry_base:
default: '$CI_REGISTRY/components/opentofu'
# FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722
# gitlab_opentofu_image:
......@@ -64,7 +64,7 @@ spec:
.default:
image:
name: '$[[ inputs._image_registry_base ]]/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]'
name: '$[[ inputs.image_registry_base ]]/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]'
variables:
TF_ROOT: $[[ inputs.root_dir ]]
......
include:
- component: gitlab.com/$CI_PROJECT_PATH/full-pipeline@$CI_COMMIT_SHA
inputs:
_image_registry_base: $GITLAB_OPENTOFU_IMAGE_BASE
image_registry_base: $GITLAB_OPENTOFU_IMAGE_BASE
version: $CI_COMMIT_SHA
opentofu_version: $OPENTOFU_VERSION
root_dir: $TEST_TF_ROOT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment