-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.travis.yml
42 lines (38 loc) · 1.15 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
dist: trusty
node_js:
- '8'
addons:
ssh_known_hosts:
- viz.vsp.tu-berlin.de
branches:
only:
- master
- staging
- dev
# build the webapp into ./dist
# travis doesn't have the option to run different builds for different branches, so we have to
# it with ugly bash if statements
script:
- if [ -f src/firebase-secure.js ]; then sed -i "s/{{FIREBASE_KEY}}/$FIREBASE_KEY/" src/firebase-secure.js; fi
- if [ "$TRAVIS_BRANCH" == "master" ]; then yarn run build && yarn run unit; fi
- if [ "$TRAVIS_BRANCH" == "staging" ]; then yarn run build-staging && yarn run unit; fi
- if [ "$TRAVIS_BRANCH" == "dev" ]; then yarn run build-dev && yarn run unit; fi
# the script statement for each deploy refer to the deploy.sh script because the script tag in the deploy section
# only supports one command...
deploy:
- on:
branch: master
provider: script
script: bash deploy.sh viz
skip_cleanup: true
- on:
branch: staging
provider: script
script: bash deploy.sh viz-staging
skip_cleanup: true
- on:
branch: dev
provider: script
script: bash deploy.sh viz-dev
skip_cleanup: true