diff --git a/.circleci/config.yml b/.circleci/config.yml index b8cf1c5..26bf41f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -240,6 +240,7 @@ jobs: apk update apk add tar gzip apk add npm nodejs + apk add --no-cache curl apk add --update ansible aws-cli - run: name: Get backend url @@ -276,6 +277,7 @@ jobs: apk update apk add tar gzip apk add npm nodejs + apk add --no-cache curl apk add --update ansible aws-cli - run: name: Deploy backend @@ -347,6 +349,7 @@ jobs: apk add npm nodejs node -v npm -v + apk add --no-cache curl apk add --update ansible aws-cli - run: name: Update cloudfront distribution @@ -372,21 +375,12 @@ jobs: --no-paginate --output text) echo OldWorkflowID: "${OldWorkflowID}" echo CIRCLE_WORKFLOW_ID "${CIRCLE_WORKFLOW_ID:0:7}" - - export STACKS=($(aws cloudformation list-stacks --query "StackSummaries[*].StackName" \ - --stack-status-filter CREATE_COMPLETE --no-paginate --output text)) - echo Stack names: "${STACKS[@]}" - run: name: Remove old stacks and files command: | - if [[ "${STACKS[@]}" =~ "${OldWorkflowID}" ]] - then - aws s3 rm "s3://udapeople-${OldWorkflowID}" --recursive - aws cloudformation delete-stack --stack-name "udapeople-backend-${OldWorkflowID}" - aws cloudformation delete-stack --stack-name "udapeople-frontend-${OldWorkflowID}" - else - echo "==========================Error while delete old stacks==========================" - fi + aws s3 rm "s3://udapeople-${OldWorkflowID}" --recursive + aws cloudformation delete-stack --stack-name "udapeople-backend-${OldWorkflowID}" + aws cloudformation delete-stack --stack-name "udapeople-frontend-${OldWorkflowID}" workflows: default: