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