From e704b192e4d7c4b6b1f010024608d7779ce8bc3f Mon Sep 17 00:00:00 2001 From: Thomas de Grenier de Latour <thomas.degrenierdelatour@orange.com> Date: Tue, 2 Jul 2024 23:13:51 +0200 Subject: [PATCH] Use CI_TEMPLATE_REGISTRY_HOST to ease mirroring on self-managed --- .gitlab/README.md.template | 6 +++--- README.md | 8 ++++---- templates/apply.yml | 6 +++--- templates/custom-command.yml | 6 +++--- templates/destroy.yml | 6 +++--- templates/fmt.yml | 6 +++--- templates/full-pipeline.yml | 6 +++--- templates/graph.yml | 6 +++--- templates/job-templates.yml | 6 +++--- templates/plan.yml | 6 +++--- templates/test.yml | 6 +++--- templates/validate-plan-apply.yml | 6 +++--- templates/validate-plan-destroy.yml | 6 +++--- templates/validate-plan.yml | 6 +++--- templates/validate.yml | 6 +++--- 15 files changed, 46 insertions(+), 46 deletions(-) diff --git a/.gitlab/README.md.template b/.gitlab/README.md.template index 2120dba..8bbc4cc 100644 --- a/.gitlab/README.md.template +++ b/.gitlab/README.md.template @@ -235,10 +235,10 @@ and as the `version` input. Check out the [Usage](#Usage) section for examples. Each component release deploys the following images: -- `$CI_REGISTRY/components/opentofu/gitlab-opentofu:<VERSION>-opentofu<OPENTOFU_VERSION>` -- `$CI_REGISTRY/components/opentofu/gitlab-opentofu:<VERSION>-opentofu` +- `$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:<VERSION>-opentofu<OPENTOFU_VERSION>` +- `$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:<VERSION>-opentofu` - Includes the latest stable OpenTofu version at the time of releasing the component -- `$CI_REGISTRY/components/opentofu/gitlab-opentofu:<VERSION>` +- `$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:<VERSION>` - Includes the latest stable OpenTofu version at the time of releasing the component In the above examples `<VERSION>` references the component version and `<OPENTOFU_VERSION>` diff --git a/README.md b/README.md index 9d5fcd4..fa5b763 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ Have a look at the individual template spec to learn about the available inputs. | `stage_cleanup` | `cleanup` | Defines the cleanup stage. This stage includes the `destroy` and `delete-state` jobs. | | `version` | `latest` | Version of this component. Has to be the same as the one in the component include entry. | | `opentofu_version` | `1.7.2` | OpenTofu version that should be used. Must be one of `1.7.2`, `1.7.1`, `1.7.0`, `1.7.0-alpha1`, `1.6.2`, `1.6.1`, `1.6.0`. | -| `image_registry_base` | `$CI_REGISTRY/components/opentofu` | Host URI to the job images. Will be combined with `image_name` to construct the actual image URI. | +| `image_registry_base` | `$CI_TEMPLATE_REGISTRY_HOST/components/opentofu` | Host URI to the job images. Will be combined with `image_name` to construct the actual image URI. | | `image_name` | `gitlab-opentofu` | Image name for the job images. Hosted under `image_registry_base`. | | `root_dir` | `${CI_PROJECT_DIR}` | Root directory for the OpenTofu project. | | `state_name` | `default` | Remote OpenTofu state name. | @@ -262,10 +262,10 @@ and as the `version` input. Check out the [Usage](#Usage) section for examples. Each component release deploys the following images: -- `$CI_REGISTRY/components/opentofu/gitlab-opentofu:<VERSION>-opentofu<OPENTOFU_VERSION>` -- `$CI_REGISTRY/components/opentofu/gitlab-opentofu:<VERSION>-opentofu` +- `$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:<VERSION>-opentofu<OPENTOFU_VERSION>` +- `$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:<VERSION>-opentofu` - Includes the latest stable OpenTofu version at the time of releasing the component -- `$CI_REGISTRY/components/opentofu/gitlab-opentofu:<VERSION>` +- `$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:<VERSION>` - Includes the latest stable OpenTofu version at the time of releasing the component In the above examples `<VERSION>` references the component version and `<OPENTOFU_VERSION>` diff --git a/templates/apply.yml b/templates/apply.yml index a660401..0dca33a 100644 --- a/templates/apply.yml +++ b/templates/apply.yml @@ -30,14 +30,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: diff --git a/templates/custom-command.yml b/templates/custom-command.yml index 3ac5636..ca21089 100644 --- a/templates/custom-command.yml +++ b/templates/custom-command.yml @@ -30,14 +30,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: diff --git a/templates/destroy.yml b/templates/destroy.yml index 9422858..d444793 100644 --- a/templates/destroy.yml +++ b/templates/destroy.yml @@ -30,14 +30,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: diff --git a/templates/fmt.yml b/templates/fmt.yml index fe8ff9c..a14d672 100644 --- a/templates/fmt.yml +++ b/templates/fmt.yml @@ -30,14 +30,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: diff --git a/templates/full-pipeline.yml b/templates/full-pipeline.yml index 1fcfeb2..f7d90d0 100644 --- a/templates/full-pipeline.yml +++ b/templates/full-pipeline.yml @@ -39,14 +39,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: diff --git a/templates/graph.yml b/templates/graph.yml index bb39c8c..96ed04e 100644 --- a/templates/graph.yml +++ b/templates/graph.yml @@ -30,14 +30,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: diff --git a/templates/job-templates.yml b/templates/job-templates.yml index 394637c..8e3c507 100644 --- a/templates/job-templates.yml +++ b/templates/job-templates.yml @@ -39,14 +39,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: diff --git a/templates/plan.yml b/templates/plan.yml index 5509b16..6c73d5b 100644 --- a/templates/plan.yml +++ b/templates/plan.yml @@ -30,14 +30,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: diff --git a/templates/test.yml b/templates/test.yml index e98dac6..9736622 100644 --- a/templates/test.yml +++ b/templates/test.yml @@ -30,14 +30,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: diff --git a/templates/validate-plan-apply.yml b/templates/validate-plan-apply.yml index 7448a52..8946b01 100644 --- a/templates/validate-plan-apply.yml +++ b/templates/validate-plan-apply.yml @@ -33,14 +33,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: diff --git a/templates/validate-plan-destroy.yml b/templates/validate-plan-destroy.yml index c611e82..f61b4c1 100644 --- a/templates/validate-plan-destroy.yml +++ b/templates/validate-plan-destroy.yml @@ -33,14 +33,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: diff --git a/templates/validate-plan.yml b/templates/validate-plan.yml index 305e847..a5edc2a 100644 --- a/templates/validate-plan.yml +++ b/templates/validate-plan.yml @@ -30,14 +30,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: diff --git a/templates/validate.yml b/templates/validate.yml index 41f44a7..8ce6e44 100644 --- a/templates/validate.yml +++ b/templates/validate.yml @@ -30,14 +30,14 @@ spec: # Images image_registry_base: - default: '$CI_REGISTRY/components/opentofu' + default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu' description: 'Host URI to the job images. Will be combined with `image_name` to construct the actual image URI.' # FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722 # gitlab_opentofu_image: # # FIXME: This should reference the component tag that is used. # # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275 - # # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' - # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' + # # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]' + # default: '$CI_TEMPLATE_REGISTRY_HOST/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]' # description: 'Tag of the gitlab-opentofu image.' image_name: -- GitLab