-
Notifications
You must be signed in to change notification settings - Fork 14
/
buildspec.yml
43 lines (41 loc) · 1.35 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
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
commands:
# remove package-lock before updating npm, otherwise not all dependencies will install
- rm package-lock.json
# update npm to 5.6.0 due to package-lock bug: https://github.com/npm/npm/issues/18135
- npm install --silent --progress=false -g npm
# install dependencies
- npm install --silent --progress=false -g serverless
- npm install --silent --progress-false
- npm --version
build:
commands:
# linting and unit tests
- npm run-script lint
- npm test
# deploy integration testing environment
- serverless deploy --stage test -v
# integration tests
- npm run-script integration
# create directory for deployment packages
- mkdir artifacts
# create staging deployment package
- mkdir artifacts/stg
- serverless package --package artifacts/stg --stage stg -v
# create prod deployment package
- mkdir artifacts/prod
- serverless package --package artifacts/prod --stage prod -v
post_build:
commands:
# tear down integration testing environment
- serverless remove --stage test -v
artifacts:
files:
# export artifacts needed for staging and prod deployments to an S3 bucket
- artifacts/**/*
- serverless.yml
- deploy.sh