Skip to content
Snippets Groups Projects
Unverified Commit de9b9e37 authored by Timo Furrer's avatar Timo Furrer
Browse files

Support input in plan job to generate a destroy plan

parent a990ad18
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,10 @@ spec:
state_name:
default: default
description: 'Remote OpenTofu state name.'
destroy_plan:
default: false
type: boolean
description: 'Set to `true` to generate a destroy instead of an apply plan.'
---
......@@ -78,5 +82,12 @@ spec:
image:
name: '$[[ inputs.image_registry_base ]]/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]'
script:
- gitlab-tofu plan
- |
if !$[[ inputs.destroy_plan ]]; then
echo "gitlab-tofu plan"
gitlab-tofu plan
else
echo "gitlab-tofu plan -destroy"
gitlab-tofu plan -destroy
fi
- gitlab-tofu plan-json
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment