-
Notifications
You must be signed in to change notification settings - Fork 10
/
buildspec.yml
49 lines (46 loc) · 1.81 KB
/
buildspec.yml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
version: 0.2
env:
parameter-store:
admin_email: 'admin-email'
phases:
install:
runtime-versions:
nodejs: 10
commands:
- echo performing install phase
# Setup for Serverless
- npm install -g serverless
# Setup for Yarn
- apt-get update -y && apt-get install -y make apt-transport-https
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- apt-get update -y && apt-get install -y yarn
pre_build:
commands:
- echo performing pre_build phase
- yarn install --frozen-lockfile
- echo configuring environment variables
- cp -f services/monitoring-common/environment/config.example.json services/monitoring-common/environment/config.$STAGE.json
- sed -i "s/REGION_VALUE/${AWS_REGION}/g" services/monitoring-common/environment/config.$STAGE.json
- sed -i "s/ADMIN_EMAIL_VALUE/${admin_email}/g" services/monitoring-common/environment/config.$STAGE.json
build:
commands:
- echo performing build phase
- yarn prettier:ci
- yarn lint
- yarn test:ci
- echo "Webhook was triggered by ${CODEBUILD_WEBHOOK_TRIGGER}"
- |
if expr "${CODEBUILD_WEBHOOK_TRIGGER}" : "^pr/" >/dev/null; then
echo 'Skipping deployment for Pull Requests'
else
yarn deployAndRunE2eTests --commitId "${CODEBUILD_RESOLVED_SOURCE_VERSION}" --stage $STAGE --forceAll "${FORCE_DEPLOY_ALL:-false}"
fi
cache:
paths:
- 'node_modules/**/*'
- 'cicd/node_modules/**/*'
- 'frontend/node_modules/**/*'
- 'services/monitoring-appsync-service/node_modules/**/*'
- 'services/monitoring-common/node_modules/**/*'
- 'services/monitoring-tester-service/node_modules/**/*'