Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Opentofu
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DBS
gitlab-component
Opentofu
Commits
c4c47a78
Commit
c4c47a78
authored
8 months ago
by
mptr
Committed by
Timo Furrer
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: send init stdout to stderr
parent
41a07649
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gitlab-tofu.sh
+5
-1
5 additions, 1 deletion
src/gitlab-tofu.sh
templates/validate.yml
+1
-0
1 addition, 0 deletions
templates/validate.yml
with
6 additions
and
1 deletion
src/gitlab-tofu.sh
+
5
−
1
View file @
c4c47a78
...
...
@@ -148,6 +148,9 @@ terraform_authenticate_private_registry() {
# to calling the wrapper `terraform` commands.
TF_IMPLICIT_INIT
=
${
TF_IMPLICIT_INIT
:-
true
}
# Allows users to continue the actual command in case init failed
TF_IGNORE_INIT_ERRORS
=
${
TF_IGNORE_INIT_ERRORS
:-
false
}
terraform_init
()
{
# If TF_INIT_NO_RECONFIGURE is not set to 'true',
# a `-reconfigure` flag is added to the `terraform init` command.
...
...
@@ -157,7 +160,8 @@ 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
}
tofu
"
${
TF_CHDIR_OPT
}
"
init
"
${
@
}
"
-input
=
false
${
tf_init_reconfigure_flag
}
${
TF_INIT_FLAGS
}
\
1>&2
||
$TF_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
−
0
View file @
c4c47a78
...
...
@@ -69,6 +69,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.
image
:
name
:
'
$[[
inputs.image_registry_base
]]/$[[
inputs.image_name
]]:$[[
inputs.version
]]-opentofu$[[
inputs.opentofu_version
]]'
script
:
...
...
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