This repository has been archived by the owner on Mar 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
47 lines (47 loc) · 1.56 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
version: 0.2
env:
parameter-store:
# these values are stored in ssm
#
# set API_ROOT to your timereport-node lambda endpoint
API_ROOT: "API_ROOT"
SLACK_CLIENT_ID: "SLACK_CLIENT_ID"
SLACK_CLIENT_SECRET: "SLACK_CLIENT_SECRET"
# http://domainname-s3-website-region.amazonaws.com/#/timereport
SLACK_REDIRECT_URI: "SLACK_REDIRECT_URI"
SLACK_ROOT_API_URL: "SLACK_ROOT_API_URL"
SLACK_ACCESS_TOKEN: "SLACK_ACCESS_TOKEN"
UserPoolId: "UserPoolId"
ClientId: "ClientId"
# switch in between version; if not set default is v1
VERSION: "VERSION"
phases:
install:
commands:
# update npm to latest version
- npm update -g
# Install dependencies needed for running tests
- npm install
# Upgrade AWS CLI to the latest version
- pip install --upgrade awscli
# printenvs
- printenv
build:
commands:
- npm run build
post_build:
commands:
# copy the contents of /build to S3
- aws s3 cp --recursive --acl public-read ./dist s3://${WEBSITE_S3_BUCKET}/
# set the cache-control headers for service-worker.js to prevent
# browser caching
- >
aws s3 cp --acl public-read
--cache-control="max-age=0, no-cache, no-store, must-revalidate"
./dist/bundle.js s3://${WEBSITE_S3_BUCKET}/
# set the cache-control headers for index.html to prevent
# browser caching
- >
aws s3 cp --acl public-read
--cache-control="max-age=0, no-cache, no-store, must-revalidate"
./dist/index.html s3://${WEBSITE_S3_BUCKET}/