This repository has been archived by the owner on Jun 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathbuildspec-integ-test.yaml
31 lines (30 loc) · 1.68 KB
/
buildspec-integ-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
version: 0.2
phases:
install:
runtime-versions:
nodejs: 8
java: openjdk8
commands:
- npm install -g @vue/cli
build:
commands:
- TEST_STAGE=integ-tests-`date +%s`
- ./static-website/bin/package-static-website.sh
- mvn clean package -DpackageBucket=${PACKAGE_BUCKET}
- ./bin/deploy.sh -n $TEST_STAGE-backend -t backend/target/sam/app/packaged-template.yaml -o "Stage=$TEST_STAGE"
- ./bin/package.sh -n static-website
- ./bin/deploy.sh -n $TEST_STAGE-website -t static-website/target/sam/app/packaged-template.yaml -o "Stage=$TEST_STAGE"
- WEBSITE_URL=$(aws ssm get-parameter --name /applications/apprepo/$TEST_STAGE/s3/WebsiteBucket/WebsiteURL --query Parameter.Value --output text)
- COGNITO_USER_POOL_ID=$(aws ssm get-parameter --name /applications/apprepo/$TEST_STAGE/cognito/userpool/ApplicationsApi/Id --query Parameter.Value --output text)
- cd static-website
- echo "Running tests in Chrome"
- npm run test:e2e -- -e chrome
- echo "Running tests in Firefox"
- npm run test:e2e -- -e firefox
finally:
- cd $CODEBUILD_SRC_DIR
# Cleanup commands end with "|| true" to ensure that all of them are executed. It's ok if they fail trying to delete a resource that was never created due to a build phase error.
- WEBSITE_BUCKET=$(aws ssm get-parameter --name /applications/apprepo/$TEST_STAGE/s3/WebsiteBucket/Name --query Parameter.Value --output text) || true
- aws s3 rm s3://$WEBSITE_BUCKET --recursive || true # S3 buckets must be emptied before being deleted
- ./bin/delete-stack.sh -n $TEST_STAGE-website || true
- ./bin/delete-stack.sh -n $TEST_STAGE-backend || true