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

Add suggestion job

parent ac0c36ec
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -17,6 +17,9 @@ include:
stages: [validate, build, deploy]
suggest-component:
extends: .opentofu:suggest-component
fmt:
extends: .opentofu:fmt
......
......@@ -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'
......
......@@ -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}]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment