Skip to content

Commit

Permalink
feat: delete stack
Browse files Browse the repository at this point in the history
  • Loading branch information
martin.mueller committed Oct 13, 2020
1 parent aa5bf04 commit b75172e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
19 changes: 9 additions & 10 deletions app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,22 @@ const pipelineAppProps: PipelineAppProps = {

return new AlfInstancesStack(scope, `${name}-${account.stage}`, alfInstancesStackProps);
},
destroyStack: () => {
return false;
},
manualApprovals: (account) => {
return account.stage === 'dev' ? false : true;
},
testCommands: (account) => [
// Use 'curl' to GET the given URL and fail if it returns an error
// 'sleep 180',
// 'curl -Ssf $InstancePublicDnsName',
`npx newman run test/alf-cdk.postman_collection.json --env-var baseUrl=$RestApiEndPoint -r cli,json --reporter-json-export tmp/newman/report.json --export-environment tmp/newman/env-vars.json --export-globals tmp/newman/global-vars.json`,
'echo done! Delete all remaining Stacks!',
`aws cloudformation describe-stacks --query "Stacks[?Tags[?Key == 'alfInstanceId'][]].StackName" --region ${account.region} --output text |
awk '{print $1}' |
while read line;
do aws cloudformation delete-stack --stack-name $line --region ${account.region};
done`,
...(account.stage==='dev'? [
`npx newman run test/alf-cdk.postman_collection.json --env-var baseUrl=$RestApiEndPoint -r cli,json --reporter-json-export tmp/newman/report.json --export-environment tmp/newman/env-vars.json --export-globals tmp/newman/global-vars.json`,
'echo done! Delete all remaining Stacks!',
`aws cloudformation describe-stacks --query "Stacks[?Tags[?Key == 'alfInstanceId'][]].StackName" --region ${account.region} --output text |
awk '{print $1}' |
while read line;
do aws cloudformation delete-stack --stack-name $line --region ${account.region};
done`,
] : []),
],
};

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b75172e

Please sign in to comment.