Skip to content

Commit

Permalink
testing scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
brentley committed Aug 14, 2018
1 parent d969373 commit e4a0306
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/cycle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

./up.sh
./down.sh
62 changes: 62 additions & 0 deletions test/down.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash

set -e

cd ~/environment/ecsdemo-crystal
mu pipeline term

cd ~/environment/ecsdemo-nodejs
mu pipeline term

echo "================================"
echo "Beginning frontend pipeline term at $(date)"
cd ~/environment/ecsdemo-frontend
mu pipeline term

echo "================================"
echo "Beginning acceptance platform term at $(date)"
cd ~/environment/ecsdemo-platform
mu env term acceptance
echo "================================"
echo "Beginning production platform term at $(date)"
mu env term production

echo "================================"
echo "Beginning ecr repo delete at $(date)"
aws ecr delete-repository --repository-nam ${MU_NAMESPACE}-ecsdemo-frontend --force
aws ecr delete-repository --repository-nam ${MU_NAMESPACE}-ecsdemo-nodejs --force
aws ecr delete-repository --repository-nam ${MU_NAMESPACE}-ecsdemo-crystal --force

echo "================================"
echo "Beginning s3 bucket delete at $(date)"
export REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed 's/\(.*\)[a-z]/\1/'
)
export ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
aws s3 rm --recursive s3://${MU_NAMESPACE}-codedeploy-${REGION}-${ACCOUNT_ID}
aws s3 rm --recursive s3://${MU_NAMESPACE}-codepipeline-${REGION}-${ACCOUNT_ID}

echo "================================"
echo "Beginning cf stack delete at $(date)"
aws cloudformation delete-stack --stack-name ${MU_NAMESPACE}-iam-service-ecsdemo-frontend-acceptance
aws cloudformation delete-stack --stack-name ${MU_NAMESPACE}-iam-service-ecsdemo-frontend-production
aws cloudformation delete-stack --stack-name ${MU_NAMESPACE}-iam-service-ecsdemo-nodejs-acceptance
aws cloudformation delete-stack --stack-name ${MU_NAMESPACE}-iam-service-ecsdemo-nodejs-production
aws cloudformation delete-stack --stack-name ${MU_NAMESPACE}-iam-service-ecsdemo-crystal-acceptance
aws cloudformation delete-stack --stack-name ${MU_NAMESPACE}-iam-service-ecsdemo-crystal-production

aws cloudformation delete-stack --stack-name ${MU_NAMESPACE}-repo-ecsdemo-frontend
aws cloudformation delete-stack --stack-name ${MU_NAMESPACE}-repo-ecsdemo-nodejs
aws cloudformation delete-stack --stack-name ${MU_NAMESPACE}-repo-ecsdemo-crystal

aws cloudformation delete-stack --stack-name ${MU_NAMESPACE}-bucket-codedeploy
aws cloudformation delete-stack --stack-name ${MU_NAMESPACE}-bucket-codepipeline

echo "================================"
echo "Beginning sleep 300 at $(date)"
sleep 300 # delay waiting for all the other CF stacks to be deleted -- replace with a count of stacks or something

echo "================================"
echo "Beginning iam-common stack delete at $(date)"
aws cloudformation delete-stack --stack-name ${MU_NAMESPACE}-iam-common
echo "================================"
echo "Teardown complete at $(date)"
12 changes: 12 additions & 0 deletions test/endless.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

count=1

while true; do
echo "================================"
echo "Beginning test ${count} build at $(date)"
./cycle.sh
echo "Ending test ${count} build at $(date)"
echo "================================"
((count++))
done
26 changes: 26 additions & 0 deletions test/up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -e

echo "================================"
echo "Beginning acceptance platform build at $(date)"
cd ~/environment/ecsdemo-platform
mu env up acceptance
echo "================================"
echo "Beginning production platform build at $(date)"
mu env up production

echo "================================"
echo "Beginning frontend pipeline build at $(date)"
cd ~/environment/ecsdemo-frontend
mu pipeline up -t $GITHUB_TOKEN

echo "================================"
echo "Beginning nodejs pipeline build at $(date)"
cd ~/environment/ecsdemo-nodejs
mu pipeline up -t $GITHUB_TOKEN

echo "================================"
echo "Beginning crystal pipeline build at $(date)"
cd ~/environment/ecsdemo-crystal
mu pipeline up -t $GITHUB_TOKEN

0 comments on commit e4a0306

Please sign in to comment.