diff --git a/backports/.Base.gitlab-ci.yml b/backports/.Base.gitlab-ci.yml index 738097d3186c03a034e574d844e9d72f9270c446..43179344b66c0f36c5a5673e3bf72937cb21bb43 100644 --- a/backports/.Base.gitlab-ci.yml +++ b/backports/.Base.gitlab-ci.yml @@ -23,3 +23,30 @@ variables: TF_ROOT: ${CI_PROJECT_DIR} # The name of the state file used by the GitLab Managed Terraform state backend TF_STATE_NAME: default + +.opentofu:suggest-component: + stage: validate + needs: [] + allow_failure: true + rules: + if: '"$CI_SERVER_HOST" == "gitlab.com"' + image: alpine:3.19 + script: + - | + echo "You are using the OpenTofu CI/CD template on GitLab.com which is not recommended." + echo "This template is available for self-managed customers until CI/CD components are available to them and it will be removed asap." + echo + echo "We recommed that you migrate to the OpenTofu CI/CD component instead." + echo "The OpenTofu CI/CD component with a default configuration can be included as follows:" + echo + echo "include:" + echo " - component: gitlab.com/components/opentofu/full-pipeline@0.1.0" + echo " inputs:" + echo " version: latest" + echo " opentofu_version: 1.6.0" + echo + echo "stages: [validate, test, build, deploy]" + echo + echo "You can read about more about the OpenTofu CI/CD component here:" + echo "https://gitlab.com/components/opentofu" + - false diff --git a/backports/OpenTofu.gitlab-ci.yml b/backports/OpenTofu.gitlab-ci.yml index 3a5d01e510d2464fade63bc23b8644ca8149ede3..b0510cda812d546d44c98eed989eb765a43765d9 100644 --- a/backports/OpenTofu.gitlab-ci.yml +++ b/backports/OpenTofu.gitlab-ci.yml @@ -17,6 +17,9 @@ include: stages: [validate, build, deploy] +suggest-component: + extends: .opentofu:suggest-component + fmt: extends: .opentofu:fmt diff --git a/backports/OpenTofu/Base.gitlab-ci.yml b/backports/OpenTofu/Base.gitlab-ci.yml index cf52a46aa778b727ec1311d1dd1716bfb9e45cfe..cf127ac4208514c376a91965c9ce83d151352206 100644 --- a/backports/OpenTofu/Base.gitlab-ci.yml +++ b/backports/OpenTofu/Base.gitlab-ci.yml @@ -24,6 +24,33 @@ variables: # The name of the state file used by the GitLab Managed Terraform state backend TF_STATE_NAME: default +.opentofu:suggest-component: + stage: validate + needs: [] + allow_failure: true + rules: + if: '"$CI_SERVER_HOST" == "gitlab.com"' + image: alpine:3.19 + script: + - | + echo "You are using the OpenTofu CI/CD template on GitLab.com which is not recommended." + echo "This template is available for self-managed customers until CI/CD components are available to them and it will be removed asap." + echo + echo "We recommed that you migrate to the OpenTofu CI/CD component instead." + echo "The OpenTofu CI/CD component with a default configuration can be included as follows:" + echo + echo "include:" + echo " - component: gitlab.com/components/opentofu/full-pipeline@0.1.0" + echo " inputs:" + echo " version: latest" + echo " opentofu_version: 1.6.0" + echo + echo "stages: [validate, test, build, deploy]" + echo + echo "You can read about more about the OpenTofu CI/CD component here:" + echo "https://gitlab.com/components/opentofu" + - false + .opentofu:default: image: name: '$GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE/gitlab-opentofu:$GITLAB_OPENTOFU_VERSION-opentofu$OPENTOFU_VERSION' diff --git a/tests/integration-tests/BackportTemplates.gitlab-ci.yml b/tests/integration-tests/BackportTemplates.gitlab-ci.yml index a6e872bf157d7ccef9513aacfa8de8a3742596fd..25651851e016155bab22f7a7d32e0aee1220b6aa 100644 --- a/tests/integration-tests/BackportTemplates.gitlab-ci.yml +++ b/tests/integration-tests/BackportTemplates.gitlab-ci.yml @@ -5,6 +5,9 @@ stages: [validate, test, build, deploy, cleanup] # Required to run everything immediately, instead of manually. +suggest-component: + extends: .opentofu:suggest-component + fmt: extends: .opentofu:fmt rules: [{when: always}]