-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathbuildspec.yml
31 lines (27 loc) · 1018 Bytes
/
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
version: 0.2
phases:
install:
runtime-versions:
nodejs: latest
commands:
- cd canaries
- npm ci
- export CANARY_CODE_FILENAME=trivia-game-canary-code-`echo $CODEBUILD_BUILD_ID | awk -F":" '{print $2}'`.zip
build:
commands:
- mkdir -p nodejs/
- cp -a node_modules/ nodejs/
- cp canary.js nodejs/node_modules/
- zip -r $CANARY_CODE_FILENAME nodejs/
- aws s3 cp $CANARY_CODE_FILENAME s3://$ARTIFACTS_BUCKET/
- cp template.yaml TriviaGameCanariesTest.template.yaml
- cp template.yaml TriviaGameCanariesProd.template.yaml
- sed -i "s/SOURCE_BUCKET/$ARTIFACTS_BUCKET/g" StackConfigTest.json StackConfigProd.json
- sed -i "s/SOURCE_OBJECT_KEY/$CANARY_CODE_FILENAME/g" StackConfigTest.json StackConfigProd.json
artifacts:
files:
- canaries/TriviaGameCanariesTest.template.yaml
- canaries/TriviaGameCanariesProd.template.yaml
- canaries/StackConfigTest.json
- canaries/StackConfigProd.json
discard-paths: yes