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

Rename `TF_APPLY_NO_PLAN` to `GITLAB_TOFU_APPLY_NO_PLAN`

Changelog: changed
parent df9639ea
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
# Respected Environment Variables: # Respected Environment Variables:
# -------------------------------- # --------------------------------
# GITLAB_TOFU_SOURCE: forces this script in source-mode. Required when source auto-detection fails. # GITLAB_TOFU_SOURCE: forces this script in source-mode. Required when source auto-detection fails.
# GITLAB_TOFU_APPLY_NO_PLAN: if set to true, the apply command does not use a plan cache file.
# #
# OpenTofu Environment Variables: # OpenTofu Environment Variables:
# > these are variables that are # > these are variables that are
...@@ -111,8 +112,8 @@ if [ -z "${TF_PLAN_NAME}" ]; then ...@@ -111,8 +112,8 @@ if [ -z "${TF_PLAN_NAME}" ]; then
TF_PLAN_NAME=plan TF_PLAN_NAME=plan
fi fi
if [ -z "${TF_APPLY_NO_PLAN}" ]; then if [ -z "${GITLAB_TOFU_APPLY_NO_PLAN}" ]; then
TF_APPLY_NO_PLAN=false GITLAB_TOFU_APPLY_NO_PLAN=false
fi fi
# If TF_ROOT is set then use the -chdir option # If TF_ROOT is set then use the -chdir option
...@@ -231,7 +232,7 @@ if [ $sourced -eq 0 ]; then ...@@ -231,7 +232,7 @@ if [ $sourced -eq 0 ]; then
case "${1}" in case "${1}" in
"apply") "apply")
$TF_IMPLICIT_INIT && terraform_init $TF_IMPLICIT_INIT && terraform_init
if [ "$TF_APPLY_NO_PLAN" = false ]; then if [ "$GITLAB_TOFU_APPLY_NO_PLAN" = false ]; then
tofu "${TF_CHDIR_OPT}" "${@}" -input=false -auto-approve "${TF_PLAN_CACHE}" tofu "${TF_CHDIR_OPT}" "${@}" -input=false -auto-approve "${TF_PLAN_CACHE}"
else else
# shellcheck disable=SC2086 # shellcheck disable=SC2086
......
...@@ -111,7 +111,7 @@ spec: ...@@ -111,7 +111,7 @@ spec:
__CACHE_KEY_HACK: "$[[ inputs.root_dir ]]" __CACHE_KEY_HACK: "$[[ inputs.root_dir ]]"
TF_ROOT: $[[ inputs.root_dir ]] TF_ROOT: $[[ inputs.root_dir ]]
TF_STATE_NAME: $[[ inputs.state_name ]] TF_STATE_NAME: $[[ inputs.state_name ]]
TF_APPLY_NO_PLAN: $[[ inputs.no_plan ]] GITLAB_TOFU_APPLY_NO_PLAN: $[[ inputs.no_plan ]]
TF_PLAN_NAME: $[[ inputs.plan_name ]] TF_PLAN_NAME: $[[ inputs.plan_name ]]
GITLAB_TOFU_VAR_FILE: '$[[ inputs.var_file ]]' GITLAB_TOFU_VAR_FILE: '$[[ inputs.var_file ]]'
image: image:
......
...@@ -111,7 +111,7 @@ spec: ...@@ -111,7 +111,7 @@ spec:
__CACHE_KEY_HACK: "$[[ inputs.root_dir ]]" __CACHE_KEY_HACK: "$[[ inputs.root_dir ]]"
TF_ROOT: $[[ inputs.root_dir ]] TF_ROOT: $[[ inputs.root_dir ]]
TF_STATE_NAME: $[[ inputs.state_name ]] TF_STATE_NAME: $[[ inputs.state_name ]]
TF_APPLY_NO_PLAN: $[[ inputs.no_plan ]] GITLAB_TOFU_APPLY_NO_PLAN: $[[ inputs.no_plan ]]
TF_PLAN_NAME: $[[ inputs.plan_name ]] TF_PLAN_NAME: $[[ inputs.plan_name ]]
GITLAB_TOFU_VAR_FILE: '$[[ inputs.var_file ]]' GITLAB_TOFU_VAR_FILE: '$[[ inputs.var_file ]]'
image: image:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment