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
2d8e1765
Unverified
Commit
2d8e1765
authored
9 months ago
by
Timo Furrer
Browse files
Options
Downloads
Patches
Plain Diff
Introduce auto-approve with FF
parent
6d1b76c1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab/README.md.template
+1
-0
1 addition, 0 deletions
.gitlab/README.md.template
README.md
+1
-0
1 addition, 0 deletions
README.md
src/gitlab-tofu.sh
+11
-2
11 additions, 2 deletions
src/gitlab-tofu.sh
with
13 additions
and
2 deletions
.gitlab/README.md.template
+
1
−
0
View file @
2d8e1765
...
...
@@ -105,6 +105,7 @@ but no destructive actions.
- [`validate-plan`](templates/validate-plan.yml)
- [`validate-plan-apply`](templates/validate-plan-apply.yml)
- [`validate-plan-destroy`](templates/validate-plan-destroy.yml)
### Job Templates
...
...
This diff is collapsed.
Click to expand it.
README.md
+
1
−
0
View file @
2d8e1765
...
...
@@ -107,6 +107,7 @@ but no destructive actions.
-
[
`validate-plan`
](
templates/validate-plan.yml
)
-
[
`validate-plan-apply`
](
templates/validate-plan-apply.yml
)
-
[
`validate-plan-destroy`
](
templates/validate-plan-destroy.yml
)
### Job Templates
...
...
This diff is collapsed.
Click to expand it.
src/gitlab-tofu.sh
+
11
−
2
View file @
2d8e1765
...
...
@@ -16,6 +16,10 @@ if [ -z "$TF_FF_AUTO_URLENCODE_STATE_NAME" ]; then
TF_FF_AUTO_URLENCODE_STATE_NAME
=
true
fi
if
[
-z
"
$TF_FF_AUTO_APPROVE_APPLY
"
]
;
then
TF_FF_AUTO_APPROVE_APPLY
=
true
fi
# Helpers
# Evaluate if this script is being sourced or executed directly.
...
...
@@ -165,11 +169,16 @@ if [ $sourced -eq 0 ]; then
case
"
${
1
}
"
in
"apply"
)
auto_approve_args
=
""
if
[
"
${
TF_FF_AUTO_APPROVE_APPLY
}
"
=
true
]
;
then
auto_approve_args
=
"-auto-approve"
fi
$TF_IMPLICIT_INIT
&&
terraform_init
if
[
"
$TF_APPLY_NO_PLAN
"
=
false
]
;
then
tofu
"
${
TF_CHDIR_OPT
}
"
"
${
@
}
"
-input
=
false
"
${
TF_PLAN_CACHE
}
"
tofu
"
${
TF_CHDIR_OPT
}
"
"
${
@
}
"
-input
=
false
"
${
auto_approve_args
}
"
"
${
TF_PLAN_CACHE
}
"
else
tofu
"
${
TF_CHDIR_OPT
}
"
"
${
@
}
"
-input
=
false
tofu
"
${
TF_CHDIR_OPT
}
"
"
${
@
}
"
-input
=
false
"
${
auto_approve_args
}
"
fi
;;
"destroy"
)
...
...
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