Commit 6d6427ae authored by Póra Krisztián's avatar Póra Krisztián
Browse files

refactor(ci): cleaner solution for destroy

parent e6261ad7
Pipeline #14942 passed with stages
in 2 minutes and 59 seconds
......@@ -99,8 +99,8 @@ openstack:test:
allow_failure: true
needs: ["openstack:build"]
# Template for OpenStack destroy jobs: terraform backend is set up with a script, terraform is initialized, infrastructure is destroyed.
.destroy_job: &destroy_job
# OpenStack destroy job: terraform backend is set up with a script, terraform is initialized, infrastructure is destroyed. Destroy is executed regardless of previous jobs.
openstack:destroy:
<<: *pipeline_template
stage: destroy
script:
......@@ -109,21 +109,4 @@ openstack:test:
- . ../ci/scripts/set-backend-config.sh $TERRAFORM_STATE_ADDRESS openstack-terraform-state $GITLAB_ACCESS_TOKEN
- terraform init -reconfigure
- terraform destroy -auto-approve
# Destroy job executed on test success
openstack:destroy_test_success:
<<: *destroy_job
needs: ["openstack:test"]
when: on_success
# Destroy job executed on test failure
openstack:destroy_test_failure:
<<: *destroy_job
needs: ["openstack:test"]
when: on_failure
# Destroy job executed on build failure
openstack:destroy_build_failure:
<<: *destroy_job
needs: ["openstack:build"]
when: on_failure
when: always
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment