-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
50 lines (44 loc) · 1.5 KB
/
.travis.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
50
language: node_js
node_js:
- "12.16.2"
deploy_service_job: &DEPLOY_SERVICE_JOB
cache:
directories:
- node_modules
install:
- npm install -g serverless
- npm install
- npm install wait-on
script:
- serverless config credentials --provider aws --key ${AWS_ACCESS_KEY_ID_DEVELOPMENT} --secret ${AWS_SECRET_ACCESS_KEY_DEVELOPMENT} --profile serverless-user -o
# - serverless offline start && wait-on http://localhost:3000 &
- npm run lint
# - sls test
- npm run test:unit
# - npm run test:int
- serverless deploy -s ${STAGE_NAME} --aws-profile serverless-user
# - kill $(jobs -p) || true
environments:
# - &PRODUCTION_ENV
# - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID_PRODUCTION}
# - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY_PRODUCTION}
- &DEVELOPMENT_ENV
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID_DEVELOPMENT}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY_DEVELOPMENT}
- SERVERLESS_ACCESS_KEY=${SERVERLESS_ACCESS_KEY}
jobs:
include:
# master deploys to 'dev', however, in future, master will deploy to 'prod'
- <<: *DEPLOY_SERVICE_JOB
name: "Deploy Dev API"
if: type = push AND NOT branch = master
env:
- STAGE_NAME=${TRAVIS_BRANCH}
- *DEVELOPMENT_ENV
# TODO: in future master will deploy to 'prod'
# - <<: *DEPLOY_SERVICE_JOB
# name: "Production Deploy API"
# if: type = push AND branch = master
# env:
# - STAGE_NAME=${TRAVIS_BRANCH}
# - *PRODUCTION_ENV