From be192c2996ff7c60f9f9aff688b549e968b71584 Mon Sep 17 00:00:00 2001 From: jandroav Date: Tue, 28 May 2024 14:08:44 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20(ephemeral-cloud-infra.yml):=20a?= =?UTF-8?q?dd=20enable=20and=20disable=20commands=20to=20manage=20stack=20?= =?UTF-8?q?state=20before=20and=20after=20destroy=20operations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ephemeral-cloud-infra.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ephemeral-cloud-infra.yml b/.github/workflows/ephemeral-cloud-infra.yml index 2ebf0ea1..71f23eb4 100644 --- a/.github/workflows/ephemeral-cloud-infra.yml +++ b/.github/workflows/ephemeral-cloud-infra.yml @@ -99,6 +99,7 @@ jobs: spacectl stack environment setvar --id $EPHEMERAL_STACK_ID TF_VAR_create_dynamodb ${{ inputs.dynamodb }} spacectl stack environment setvar --id $EPHEMERAL_STACK_ID TF_VAR_create_documentdb ${{ inputs.documentdb }} spacectl stack deploy --id $EPHEMERAL_STACK_ID --auto-confirm + spacectl stack disable --id $EPHEMERAL_STACK_ID - name: Destroy ephemeral infra continue-on-error: true @@ -107,7 +108,9 @@ jobs: if: ${{ inputs.destroy }} working-directory: test-automation-ephemeral/infra run: | + spacectl stack enable --id $EPHEMERAL_STACK_ID spacectl stack task --id ${{ inputs.stack_id }} --tail "terraform destroy -refresh=false -parallelism=10 -auto-approve" + spacectl stack disable --id $EPHEMERAL_STACK_ID - name: Download Terraform state if: ${{ inputs.destroy }} @@ -120,4 +123,5 @@ jobs: if: ${{ inputs.destroy }} working-directory: test-automation-ephemeral/stack run: | + spacectl stack enable --id $EPHEMERAL_STACK_ID terraform destroy -auto-approve