-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildspec.yml
29 lines (27 loc) · 934 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
version: 0.2
phases:
install:
commands:
- echo Install dependencies...
- npm install
pre_build:
commands:
- echo node version...
- node -v
- echo npm version...
- npm -v
- echo Run unit tests...
- npm run test
build:
commands:
- echo Build application...
- npm run build
- echo Set version in index.html
post_build:
commands:
- echo Distribute to S3.
- aws s3 sync dist/ s3://${S3_BUCKET_PROJECT} --delete --region ${S3_REGION}
- echo Update Cache-Control Header on index.html...
- aws s3 cp s3://${S3_BUCKET_PROJECT}/index.html s3://${S3_BUCKET_PROJECT}/index.html --region ${S3_REGION} --cache-control "no-cache,no-store" --metadata-directive "REPLACE"
- echo Upload build to S3 vas.builds to archive...
- aws s3 cp dist s3://${S3_BUCKET_ARCHIVE}/${CODEBUILD_BUILD_ID}/ --region ${S3_REGION} --recursive