-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (39 loc) · 1.63 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
language: node_js
node_js:
- "10.17.0"
cache: yarn
before_install:
- export COMMITTER_EMAIL="$(git log -1 $TRAVIS_COMMIT --pretty="%cE")"
- export AUTHOR_NAME="$(git log -1 $TRAVIS_COMMIT --pretty="%aN")"
- yarn global add jest now
- cd app && yarn
- cd ..
jobs:
include:
- stage: tests
install:
- cd app
script:
- yarn test
- stage: deploy-dev
if: "(NOT env(AUTHOR_NAME) =~ ^Travis AND (NOT type IN (pull_request)) AND (branch= development))"
script:
- DEPLOYMENT=$(now --scope kauri --token=$NOW_TOKEN); exitVal=$?
- if [ "$exitVal" -eq 0 ]; then now alias --scope kauri --token=$NOW_TOKEN $DEPLOYMENT dev.kauri.io; fi
- stage: deploy-qa
if: "(NOT env(AUTHOR_NAME) =~ ^Travis AND (NOT type IN (pull_request)) AND (branch= qa))"
script:
- DEPLOYMENT=$(now -A qa.now.json --scope kauri --token=$NOW_TOKEN); exitVal=$?
- if [ "$exitVal" -eq 0 ]; then now alias --scope kauri --token=$NOW_TOKEN $DEPLOYMENT qa.kauri.io; fi
- stage: deploy-dev2
if: "(NOT env(AUTHOR_NAME) =~ ^Travis AND (NOT type IN (pull_request)) AND (branch= dev2))"
script:
- DEPLOYMENT=$(now -A dev2.now.json --scope kauri --token=$NOW_TOKEN); exitVal=$?
- if [ "$exitVal" -eq 0 ]; then now alias --scope kauri --token=$NOW_TOKEN $DEPLOYMENT dev2.kauri.io; fi
- stage: deploy-prod
if: "(NOT env(AUTHOR_NAME) =~ ^Travis AND (NOT type IN (pull_request)) AND (branch= master))"
script:
- DEPLOYMENT=$(now -A prod.now.json --scope kauri --token=$NOW_TOKEN); exitVal=$?
- if [ "$exitVal" -eq 0 ]; then
now alias --scope kauri --token=$NOW_TOKEN $DEPLOYMENT kauri.io;
fi