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

Fix auto deploy and auto destroy in backports

parent 8345e214
No related branches found
No related tags found
No related merge requests found
...@@ -32,8 +32,8 @@ backports: ...@@ -32,8 +32,8 @@ backports:
@sed '1,/^---$$/d' templates/fmt.yml | sed -e 's/$$\[\[ inputs.as \]\]/.opentofu:fmt/' | sed -e 's/$$\[\[ inputs.stage \]\]/validate/' | sed -e 's/$$\[\[ inputs.allow_failure \]\]/true/' >> $(BACKPORTS_BASE_FILE) @sed '1,/^---$$/d' templates/fmt.yml | sed -e 's/$$\[\[ inputs.as \]\]/.opentofu:fmt/' | sed -e 's/$$\[\[ inputs.stage \]\]/validate/' | sed -e 's/$$\[\[ inputs.allow_failure \]\]/true/' >> $(BACKPORTS_BASE_FILE)
@sed '1,/^---$$/d' templates/validate.yml | sed -e 's/$$\[\[ inputs.as \]\]/.opentofu:validate/' | sed -e 's/$$\[\[ inputs.stage \]\]/validate/' >> $(BACKPORTS_BASE_FILE) @sed '1,/^---$$/d' templates/validate.yml | sed -e 's/$$\[\[ inputs.as \]\]/.opentofu:validate/' | sed -e 's/$$\[\[ inputs.stage \]\]/validate/' >> $(BACKPORTS_BASE_FILE)
@sed '1,/^---$$/d' templates/plan.yml | sed -e 's/$$\[\[ inputs.as \]\]/.opentofu:plan/' | sed -e 's/$$\[\[ inputs.stage \]\]/build/' >> $(BACKPORTS_BASE_FILE) @sed '1,/^---$$/d' templates/plan.yml | sed -e 's/$$\[\[ inputs.as \]\]/.opentofu:plan/' | sed -e 's/$$\[\[ inputs.stage \]\]/build/' >> $(BACKPORTS_BASE_FILE)
@sed '1,/^---$$/d' templates/apply.yml | sed -e 's/$$\[\[ inputs.as \]\]/.opentofu:apply/' | sed -e 's/$$\[\[ inputs.stage \]\]/deploy/' | sed -e 's/$$\[\[ inputs.auto_apply \]\]/$$_TF_AUTO_APPLY/' >> $(BACKPORTS_BASE_FILE) @sed '1,/^---$$/d' templates/apply.yml | sed -e 's/$$\[\[ inputs.as \]\]/.opentofu:apply/' | sed -e 's/$$\[\[ inputs.stage \]\]/deploy/' | sed -e 's/"$$\[\[ inputs.auto_apply \]\]"/$$_TF_AUTO_APPLY/' >> $(BACKPORTS_BASE_FILE)
@sed '1,/^---$$/d' templates/destroy.yml | sed -e 's/$$\[\[ inputs.as \]\]/.opentofu:destroy/' | sed -e 's/$$\[\[ inputs.stage \]\]/cleanup/' | sed -e 's/$$\[\[ inputs.auto_destroy \]\]/$$_TF_AUTO_DESTROY/' | sed -e 's/$$\[\[ inputs.create_destroy_job \]\]/$$TF_CREATE_DESTROY_JOB/' >> $(BACKPORTS_BASE_FILE) @sed '1,/^---$$/d' templates/destroy.yml | sed -e 's/$$\[\[ inputs.as \]\]/.opentofu:destroy/' | sed -e 's/$$\[\[ inputs.stage \]\]/cleanup/' | sed -e 's/"$$\[\[ inputs.auto_destroy \]\]"/$$_TF_AUTO_DESTROY/' | sed -e 's/$$\[\[ inputs.create_destroy_job \]\]/$$TF_CREATE_DESTROY_JOB/' >> $(BACKPORTS_BASE_FILE)
@sed '1,/^---$$/d' templates/delete-state.yml | sed -e 's/$$\[\[ inputs.as \]\]/.opentofu:delete-state/' | sed -e 's/$$\[\[ inputs.stage \]\]/cleanup/' | sed -e 's/$$\[\[ inputs.create_delete_state_job \]\]/$$TF_CREATE_DELETE_STATE_JOB/' >> $(BACKPORTS_BASE_FILE) @sed '1,/^---$$/d' templates/delete-state.yml | sed -e 's/$$\[\[ inputs.as \]\]/.opentofu:delete-state/' | sed -e 's/$$\[\[ inputs.stage \]\]/cleanup/' | sed -e 's/$$\[\[ inputs.create_delete_state_job \]\]/$$TF_CREATE_DELETE_STATE_JOB/' >> $(BACKPORTS_BASE_FILE)
@# Common inputs @# Common inputs
......
...@@ -136,7 +136,7 @@ opentofu:use-component-instead-of-template: ...@@ -136,7 +136,7 @@ opentofu:use-component-instead-of-template:
action: start action: start
resource_group: $TF_STATE_NAME resource_group: $TF_STATE_NAME
rules: rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && "$_TF_AUTO_APPLY" == "true"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $_TF_AUTO_APPLY == "true"'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual when: manual
cache: cache:
...@@ -158,7 +158,7 @@ opentofu:use-component-instead-of-template: ...@@ -158,7 +158,7 @@ opentofu:use-component-instead-of-template:
action: stop action: stop
resource_group: $TF_STATE_NAME resource_group: $TF_STATE_NAME
rules: rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && "$_TF_AUTO_DESTROY" == "true"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $_TF_AUTO_DESTROY == "true"'
- when: manual - when: manual
cache: cache:
key: "$__CACHE_KEY_HACK" key: "$__CACHE_KEY_HACK"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment