Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenTofu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
components
OpenTofu
Commits
bee398de
Unverified
Commit
bee398de
authored
7 months ago
by
Timo Furrer
Browse files
Options
Downloads
Patches
Plain Diff
Rename `TF_IGNORE_INIT_ERRORS` to `GITLAB_TOFU_IGNORE_INIT_ERRORS`
Changelog: changed
parent
38c0e156
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gitlab-tofu.sh
+4
-3
4 additions, 3 deletions
src/gitlab-tofu.sh
templates/validate.yml
+1
-1
1 addition, 1 deletion
templates/validate.yml
with
5 additions
and
4 deletions
src/gitlab-tofu.sh
+
4
−
3
View file @
bee398de
...
...
@@ -16,7 +16,8 @@
# GITLAB_TOFU_PLAN_NAME: the name of the plan cache and json files. Defaults to `plan`.
# GITLAB_TOFU_PLAN_CACHE: if set is the full path of the plan cache file. Defaults to `<root>/$GITLAB_TOFU_PLAN_NAME.cache`
# GITLAB_TOFU_PLAN_JSON: if set is the full path of the plan json file. Defaults to `<root>/$GITLAB_TOFU_PLAN_NAME.json`
# GITLAB_TOFU_IMPLICIT_INIT: if set to true will perform an implicit tofu init before any command that require it. Defaults to `true`.
# GITLAB_TOFU_IMPLICIT_INIT: if set to true will perform an implicit `tofu init` before any command that require it. Defaults to `true`.
# GITLAB_TOFU_IGNORE_INIT_ERRORS: if set to true will ignore errors in the `tofu init` command.
#
# Respected OpenTofu Environment Variables:
# > these are variables that are
...
...
@@ -208,7 +209,7 @@ terraform_authenticate_private_registry() {
GITLAB_TOFU_IMPLICIT_INIT
=
${
GITLAB_TOFU_IMPLICIT_INIT
:-
true
}
# Allows users to continue the actual command in case init failed
TF
_IGNORE_INIT_ERRORS
=
${
TF
_IGNORE_INIT_ERRORS
:-
false
}
GITLAB_TOFU
_IGNORE_INIT_ERRORS
=
${
GITLAB_TOFU
_IGNORE_INIT_ERRORS
:-
false
}
terraform_init
()
{
# If TF_INIT_NO_RECONFIGURE is not set to 'true',
...
...
@@ -220,7 +221,7 @@ terraform_init() {
# We want to allow word splitting here for TF_INIT_FLAGS
# shellcheck disable=SC2086
tofu
"
${
tf_chdir_opt
}
"
init
"
${
@
}
"
-input
=
false
${
tf_init_reconfigure_flag
}
${
TF_INIT_FLAGS
}
\
1>&2
||
$
TF
_IGNORE_INIT_ERRORS
1>&2
||
$
GITLAB_TOFU
_IGNORE_INIT_ERRORS
}
# If this script is executed and not sourced, a terraform command is ran.
...
...
This diff is collapsed.
Click to expand it.
templates/validate.yml
+
1
−
1
View file @
bee398de
...
...
@@ -104,7 +104,7 @@ spec:
__CACHE_KEY_HACK
:
"
$[[
inputs.root_dir
]]"
TF_ROOT
:
$[[ inputs.root_dir ]]
TF_STATE_NAME
:
$[[ inputs.state_name ]]
TF
_IGNORE_INIT_ERRORS
:
'
true'
# Tofu can report errors which might be the reason init failed.
GITLAB_TOFU
_IGNORE_INIT_ERRORS
:
'
true'
# Tofu can report errors which might be the reason init failed.
GITLAB_TOFU_VAR_FILE
:
'
$[[
inputs.var_file
]]'
image
:
name
:
'
$[[
inputs.image_registry_base
]]/$[[
inputs.image_name
]]:$[[
inputs.version
]]-opentofu$[[
inputs.opentofu_version
]]-$[[
inputs.base_os
]]$[[
inputs.image_digest
]]'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment