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
b66c7ca0
Unverified
Commit
b66c7ca0
authored
7 months ago
by
Timo Furrer
Browse files
Options
Downloads
Patches
Plain Diff
Rename `TF_INIT_FLAGS` to `GITLAB_TOFU_INIT_FLAGS`
Changelog: changed
parent
f3815f14
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab/README.md.template
+1
-1
1 addition, 1 deletion
.gitlab/README.md.template
README.md
+1
-1
1 addition, 1 deletion
README.md
src/gitlab-tofu.sh
+2
-2
2 additions, 2 deletions
src/gitlab-tofu.sh
tests/unit/gitlab-tofu.bats
+2
-2
2 additions, 2 deletions
tests/unit/gitlab-tofu.bats
with
6 additions
and
6 deletions
.gitlab/README.md.template
+
1
−
1
View file @
b66c7ca0
...
@@ -328,7 +328,7 @@ we may make it the default behavior if possible.
...
@@ -328,7 +328,7 @@ we may make it the default behavior if possible.
#### Lockfile Handling
#### Lockfile Handling
If you commit the Lockfile (`.terraform.lock.hcl`) to your repository
If you commit the Lockfile (`.terraform.lock.hcl`) to your repository
we recommend setting either the `
TF
_INIT_FLAGS` (handled by this component)
we recommend setting either the `
GITLAB_TOFU
_INIT_FLAGS` (handled by this component)
or `TF_CLI_ARGS_init` (handled by OpenTofu directly) to `-lockfile=readonly`
or `TF_CLI_ARGS_init` (handled by OpenTofu directly) to `-lockfile=readonly`
to prevent any changes to the lockfile during the pipeline job and with
to prevent any changes to the lockfile during the pipeline job and with
that ensuring that OpenTofu really uses the locked dependencies.
that ensuring that OpenTofu really uses the locked dependencies.
...
...
This diff is collapsed.
Click to expand it.
README.md
+
1
−
1
View file @
b66c7ca0
...
@@ -343,7 +343,7 @@ we may make it the default behavior if possible.
...
@@ -343,7 +343,7 @@ we may make it the default behavior if possible.
#### Lockfile Handling
#### Lockfile Handling
If you commit the Lockfile (
`.terraform.lock.hcl`
) to your repository
If you commit the Lockfile (
`.terraform.lock.hcl`
) to your repository
we recommend setting either the
`
TF
_INIT_FLAGS`
(handled by this component)
we recommend setting either the
`
GITLAB_TOFU
_INIT_FLAGS`
(handled by this component)
or
`TF_CLI_ARGS_init`
(handled by OpenTofu directly) to
`-lockfile=readonly`
or
`TF_CLI_ARGS_init`
(handled by OpenTofu directly) to
`-lockfile=readonly`
to prevent any changes to the lockfile during the pipeline job and with
to prevent any changes to the lockfile during the pipeline job and with
that ensuring that OpenTofu really uses the locked dependencies.
that ensuring that OpenTofu really uses the locked dependencies.
...
...
This diff is collapsed.
Click to expand it.
src/gitlab-tofu.sh
+
2
−
2
View file @
b66c7ca0
...
@@ -258,9 +258,9 @@ terraform_init() {
...
@@ -258,9 +258,9 @@ terraform_init() {
tf_init_reconfigure_flag
=
'-reconfigure'
tf_init_reconfigure_flag
=
'-reconfigure'
fi
fi
# We want to allow word splitting here for
TF
_INIT_FLAGS
# We want to allow word splitting here for
GITLAB_TOFU
_INIT_FLAGS
# shellcheck disable=SC2086
# 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
}
${
GITLAB_TOFU
_INIT_FLAGS
}
\
1>&2
||
$GITLAB_TOFU_IGNORE_INIT_ERRORS
1>&2
||
$GITLAB_TOFU_IGNORE_INIT_ERRORS
}
}
...
...
This diff is collapsed.
Click to expand it.
tests/unit/gitlab-tofu.bats
+
2
−
2
View file @
b66c7ca0
...
@@ -35,12 +35,12 @@ teardown() {
...
@@ -35,12 +35,12 @@ teardown() {
}
}
@test "gitlab-tofu init with environment variable flags" {
@test "gitlab-tofu init with environment variable flags" {
export
TF
_INIT_FLAGS="-get=true -no-color"
export
GITLAB_TOFU
_INIT_FLAGS="-get=true -no-color"
gitlab-tofu init
gitlab-tofu init
}
}
@test "gitlab-tofu init with args and environment variable flags" {
@test "gitlab-tofu init with args and environment variable flags" {
export
TF
_INIT_FLAGS="-get=true"
export
GITLAB_TOFU
_INIT_FLAGS="-get=true"
gitlab-tofu init -no-color
gitlab-tofu init -no-color
}
}
...
...
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