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

Use apply setup for destroy integration test

parent 2d8e1765
Branches
Tags
No related merge requests found
......@@ -50,6 +50,10 @@ spec:
state_name:
default: default
description: 'Remote OpenTofu state name.'
no_plan:
default: false
type: boolean
description: 'Whether a plan file should be used.'
plan_name:
default: 'plan'
description: 'The name of the plan file to use. Will be used for TF_PLAN_CACHE and TF_PLAN_JSON.'
......@@ -79,6 +83,7 @@ spec:
__CACHE_KEY_HACK: "$[[ inputs.root_dir ]]"
TF_ROOT: $[[ inputs.root_dir ]]
TF_STATE_NAME: $[[ inputs.state_name ]]
TF_APPLY_NO_PLAN: $[[ inputs.no_plan ]]
TF_PLAN_NAME: $[[ inputs.plan_name ]]
image:
name: '$[[ inputs.image_registry_base ]]/$[[ inputs.image_name ]]:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]'
......
include:
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/apply@$CI_COMMIT_SHA
inputs:
image_registry_base: $GITLAB_OPENTOFU_IMAGE_BASE
version: $CI_COMMIT_SHA
opentofu_version: $OPENTOFU_VERSION
as: 'setup:apply'
stage: setup
root_dir: $TEST_TF_ROOT
state_name: $TEST_TF_STATE_NAME
no_plan: true
auto_apply: true
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/validate-plan-destroy@$CI_COMMIT_SHA
inputs:
image_registry_base: $GITLAB_OPENTOFU_IMAGE_BASE
......@@ -7,10 +19,13 @@ include:
root_dir: $TEST_TF_ROOT
state_name: $TEST_TF_STATE_NAME
stages: [validate, build, cleanup]
stages: [setup, validate, build, cleanup]
# Required to run everything immediately, instead of manually.
'setup:apply':
rules: [{when: always}]
fmt:
rules: [{when: always}]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment