-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
31 lines (31 loc) · 1.89 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
sudo: required
language: node_js
node_js:
- "8"
notifications:
email: false
services:
- docker
script:
- npm run test:coverage
- npm run lint:js
- npm run lint:css
- npm run lint:whitespace
- npm run lint:prettier
after_success:
- npm run build:server
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- if [ "$BRANCH" == "master" ]; then npm run build:client:master; fi
- if [ "$BRANCH" == "staging" ]; then npm run build:client:staging; fi
- if [ "$BRANCH" == "develop" ]; then npm run build:client:develop; fi
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- export REPO=forecastxl/prototype
- if [ "$BRANCH" == "master" ] || [ "$BRANCH" == "staging" ] || [ "$BRANCH" == "develop" ]; then docker build -f Dockerfile -t $REPO:$BRANCH .; fi
- if [ "$BRANCH" == "master" ]; then docker tag $REPO:$BRANCH $REPO:$(git log -n 1 --pretty=format:%f $TRAVIS_COMMIT); fi
- if [ "$BRANCH" == "master" ]; then docker tag $REPO:$BRANCH $REPO:latest; fi
- if [ "$BRANCH" == "master" ] || [ "$BRANCH" == "staging" ] || [ "$BRANCH" == "develop" ]; then docker push $REPO; fi
env:
global:
- DOCKER_USER=ismay
# DOCKER_PASS
- secure: "MXZXhNIxxiCTSxkJZbgngY5Ua3rTr2R4e9BaLNkyt0Glm9fVK9WHtgOOjrHp7os+LGEuWGZ12UxAWJAIvl8wngJtPeoBc5lEkewsqFcvcetrSeiuZiBvagrPs64D+DKMZsjWGX9hsDh3cm9Sb8xvGj2bGnHdsb7hGUW16jnsbfoyomcQRLLYQJVFACDNnu3G+Ft6c8vkmt7EdoY/pUlN8OvWsUFa6KlPy30hkuG5IlOqs5rMC8Bg4U+AuPVB5jKxh92Vm6KiXUFTA9zZBrBlNR+/h8sJPsnnmG//IwbHUOzAQd4Dk2SLjOqMEhZ4CdakgTn04BKxwraohfAPANqJ9ztIH9wjb8RwJCMBkG/5izHRVOzhyZpv4yfzwMSVUwxAlIl46HKShR4jz0FX67sSDQoWOvXvnyl/5Kco1xy+GNU7PvllXukNvIoHT/FCFFTaWWpMaz3q4p5Lv5B3NPhwJrEnK5ifRTjST91hpkSEzsyFl2m6jWIZmkLCn1Ai0fNNLLYSfP618jjnkfYLGTcOgk3mItsGpOrISKvRFNjCIsU2MKR90P5XwakNwMydt7N5gOCxe2nEUeR0kZKz49e3MYl8lyWZhy0aitPdrbKG73qsUJJTF4FhNaTAGLUSBRsGcD5b1nUXuAju5T8luynA/Fr5w5MucmyVDAUMkLrMxRs="