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
30b74af0
Unverified
Commit
30b74af0
authored
8 months ago
by
Timo Furrer
Browse files
Options
Downloads
Patches
Plain Diff
Rename `terraform_init` function to `tofu_init`
Changelog: changed
parent
b66c7ca0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gitlab-tofu.sh
+8
-8
8 additions, 8 deletions
src/gitlab-tofu.sh
with
8 additions
and
8 deletions
src/gitlab-tofu.sh
+
8
−
8
View file @
30b74af0
...
@@ -251,7 +251,7 @@ GITLAB_TOFU_IMPLICIT_INIT=${GITLAB_TOFU_IMPLICIT_INIT:-true}
...
@@ -251,7 +251,7 @@ GITLAB_TOFU_IMPLICIT_INIT=${GITLAB_TOFU_IMPLICIT_INIT:-true}
# Allows users to continue the actual command in case init failed
# Allows users to continue the actual command in case init failed
GITLAB_TOFU_IGNORE_INIT_ERRORS
=
${
GITLAB_TOFU_IGNORE_INIT_ERRORS
:-
false
}
GITLAB_TOFU_IGNORE_INIT_ERRORS
=
${
GITLAB_TOFU_IGNORE_INIT_ERRORS
:-
false
}
t
erraform
_init
()
{
t
ofu
_init
()
{
# If GITLAB_TOFU_INIT_NO_RECONFIGURE is not set to 'true',
# If GITLAB_TOFU_INIT_NO_RECONFIGURE is not set to 'true',
# a `-reconfigure` flag is added to the `terraform init` command.
# a `-reconfigure` flag is added to the `terraform init` command.
if
[
"
$GITLAB_TOFU_INIT_NO_RECONFIGURE
"
!=
'true'
]
;
then
if
[
"
$GITLAB_TOFU_INIT_NO_RECONFIGURE
"
!=
'true'
]
;
then
...
@@ -278,7 +278,7 @@ if [ $sourced -eq 0 ]; then
...
@@ -278,7 +278,7 @@ if [ $sourced -eq 0 ]; then
case
"
${
1
}
"
in
case
"
${
1
}
"
in
"apply"
)
"apply"
)
$GITLAB_TOFU_IMPLICIT_INIT
&&
t
erraform
_init
$GITLAB_TOFU_IMPLICIT_INIT
&&
t
ofu
_init
if
[
"
$GITLAB_TOFU_APPLY_NO_PLAN
"
=
false
]
;
then
if
[
"
$GITLAB_TOFU_APPLY_NO_PLAN
"
=
false
]
;
then
tofu
"
${
tf_chdir_opt
}
"
"
${
@
}
"
-input
=
false
-auto-approve
"
${
GITLAB_TOFU_PLAN_CACHE
}
"
tofu
"
${
tf_chdir_opt
}
"
"
${
@
}
"
-input
=
false
-auto-approve
"
${
GITLAB_TOFU_PLAN_CACHE
}
"
else
else
...
@@ -287,7 +287,7 @@ if [ $sourced -eq 0 ]; then
...
@@ -287,7 +287,7 @@ if [ $sourced -eq 0 ]; then
fi
fi
;;
;;
"destroy"
)
"destroy"
)
$GITLAB_TOFU_IMPLICIT_INIT
&&
t
erraform
_init
$GITLAB_TOFU_IMPLICIT_INIT
&&
t
ofu
_init
tofu
"
${
tf_chdir_opt
}
"
"
${
@
}
"
-auto-approve
tofu
"
${
tf_chdir_opt
}
"
"
${
@
}
"
-auto-approve
;;
;;
"fmt"
)
"fmt"
)
...
@@ -296,7 +296,7 @@ if [ $sourced -eq 0 ]; then
...
@@ -296,7 +296,7 @@ if [ $sourced -eq 0 ]; then
"init"
)
"init"
)
# shift argument list „one to the left“ to not call 'terraform init init'
# shift argument list „one to the left“ to not call 'terraform init init'
shift
shift
t
erraform
_init
"
${
@
}
"
t
ofu
_init
"
${
@
}
"
;;
;;
"plan"
)
"plan"
)
plan_args
=
''
plan_args
=
''
...
@@ -304,7 +304,7 @@ if [ $sourced -eq 0 ]; then
...
@@ -304,7 +304,7 @@ if [ $sourced -eq 0 ]; then
plan_args
=
'-detailed-exitcode'
plan_args
=
'-detailed-exitcode'
fi
fi
$GITLAB_TOFU_IMPLICIT_INIT
&&
t
erraform
_init
$GITLAB_TOFU_IMPLICIT_INIT
&&
t
ofu
_init
# shellcheck disable=SC2086
# shellcheck disable=SC2086
tofu
"
${
tf_chdir_opt
}
"
"
${
@
}
"
-input
=
false
-out
=
"
${
GITLAB_TOFU_PLAN_CACHE
}
"
${
var_file_args
}
${
plan_args
}
&&
ret
=
$?
||
ret
=
$?
tofu
"
${
tf_chdir_opt
}
"
"
${
@
}
"
-input
=
false
-out
=
"
${
GITLAB_TOFU_PLAN_CACHE
}
"
${
var_file_args
}
${
plan_args
}
&&
ret
=
$?
||
ret
=
$?
...
@@ -325,17 +325,17 @@ if [ $sourced -eq 0 ]; then
...
@@ -325,17 +325,17 @@ if [ $sourced -eq 0 ]; then
tofu
"
${
tf_chdir_opt
}
"
show
-json
"
${
GITLAB_TOFU_PLAN_CACHE
}
"
| jq
-r
"
${
jq_plan
}
"
>
"
${
GITLAB_TOFU_PLAN_JSON
}
"
tofu
"
${
tf_chdir_opt
}
"
show
-json
"
${
GITLAB_TOFU_PLAN_CACHE
}
"
| jq
-r
"
${
jq_plan
}
"
>
"
${
GITLAB_TOFU_PLAN_JSON
}
"
;;
;;
"validate"
)
"validate"
)
$GITLAB_TOFU_IMPLICIT_INIT
&&
t
erraform
_init
-backend
=
false
$GITLAB_TOFU_IMPLICIT_INIT
&&
t
ofu
_init
-backend
=
false
# shellcheck disable=SC2086
# shellcheck disable=SC2086
tofu
"
${
tf_chdir_opt
}
"
"
${
@
}
"
${
var_file_args
}
tofu
"
${
tf_chdir_opt
}
"
"
${
@
}
"
${
var_file_args
}
;;
;;
"test"
)
"test"
)
$GITLAB_TOFU_IMPLICIT_INIT
&&
t
erraform
_init
-backend
=
false
$GITLAB_TOFU_IMPLICIT_INIT
&&
t
ofu
_init
-backend
=
false
# shellcheck disable=SC2086
# shellcheck disable=SC2086
tofu
"
${
tf_chdir_opt
}
"
"
${
@
}
"
${
var_file_args
}
tofu
"
${
tf_chdir_opt
}
"
"
${
@
}
"
${
var_file_args
}
;;
;;
"graph"
)
"graph"
)
$GITLAB_TOFU_IMPLICIT_INIT
&&
t
erraform
_init
$GITLAB_TOFU_IMPLICIT_INIT
&&
t
ofu
_init
# shellcheck disable=SC2086
# shellcheck disable=SC2086
tofu
"
${
tf_chdir_opt
}
"
"
${
@
}
"
${
var_file_args
}
tofu
"
${
tf_chdir_opt
}
"
"
${
@
}
"
${
var_file_args
}
;;
;;
...
...
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