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

Delete state in pipeline

parent 5a510b90
No related branches found
No related tags found
No related merge requests found
...@@ -134,3 +134,14 @@ destroy: ...@@ -134,3 +134,14 @@ destroy:
action: stop action: stop
resource_group: $[[ inputs.state_name ]] resource_group: $[[ inputs.state_name ]]
when: manual when: manual
delete-state:
extends: .default
stage: $[[ inputs.stage_cleanup ]]
needs: [destroy]
resource_group: $[[ inputs.state_name ]]
rules:
- when: never
script:
- curl --request DELETE -u "gitlab-ci-token:$CI_JOB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/terraform/state/$[[ inputs.state_name ]]"
...@@ -23,3 +23,7 @@ apply: ...@@ -23,3 +23,7 @@ apply:
destroy: destroy:
rules: [{when: always}] rules: [{when: always}]
delete-state:
rules: [{when: always}]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment