From 80fbbbc188d2f8ed32423eca447419f926e37cb3 Mon Sep 17 00:00:00 2001 From: Markus Tacker Date: Tue, 27 Oct 2020 12:41:40 +0100 Subject: [PATCH] test(e2e): remove resources afterwards --- .github/workflows/test-and-release.yaml | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-and-release.yaml b/.github/workflows/test-and-release.yaml index 8e6f2b5f..8eb9e1a9 100644 --- a/.github/workflows/test-and-release.yaml +++ b/.github/workflows/test-and-release.yaml @@ -84,20 +84,20 @@ jobs: - name: Get logs if: failure() run: node cli logs - # - name: Clean up End-to-End test resources - # if: always() - # run: | - # node cli drop-athena-resources - # node cli purge-iot-user-policy-principals - # node cli purge-cas -i `cat certificates/**/rootCA.id` - # # Purge Buckets does not remove the source-code bucket (because it will be populate again by the CDK command) - # node cli purge-buckets - # npx cdk -a 'node --unhandled-rejections=strict dist/cdk/cloudformation-test.js' destroy -f '*' - # # Delete sourcecode bucket - # SOURCE_CODE_BUCKET=`aws cloudformation describe-stacks --stack-name $STACK_NAME-sourcecode | jq -r '.Stacks[0].Outputs[] | select(.OutputKey == "bucketName") | .OutputValue'` - # aws s3 rb s3://$SOURCE_CODE_BUCKET --force - # # Delete the sourceode stack - # npx cdk -a 'node --unhandled-rejections=strict dist/cdk/cloudformation-sourcecode.js' destroy -f '*' + - name: Clean up End-to-End test resources + if: always() + run: | + node cli drop-athena-resources + node cli purge-iot-user-policy-principals + node cli purge-cas -i `cat certificates/**/rootCA.id` + # Purge Buckets does not remove the source-code bucket (because it will be populate again by the CDK command) + node cli purge-buckets + npx cdk -a 'node --unhandled-rejections=strict dist/cdk/cloudformation-test.js' destroy -f '*' + # Delete sourcecode bucket + SOURCE_CODE_BUCKET=`aws cloudformation describe-stacks --stack-name $STACK_NAME-sourcecode | jq -r '.Stacks[0].Outputs[] | select(.OutputKey == "bucketName") | .OutputValue'` + aws s3 rb s3://$SOURCE_CODE_BUCKET --force + # Delete the sourceode stack + npx cdk -a 'node --unhandled-rejections=strict dist/cdk/cloudformation-sourcecode.js' destroy -f '*' release: needs: tests