-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
49 lines (42 loc) · 1.31 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
language: node_js
node_js: '10'
sudo: required
services:
- docker
addons:
chrome: stable
apt:
packages:
- chromium-chromedriver
branches:
only:
- master
cache:
directories:
- node_modules
# before_install:
# - docker run -d -p 8080:8080 udlepssoftarch/geolearning-api
# - while ! nc -z localhost 8080; do sleep 10; done
# - docker ps -a
install:
- npm install
before_script:
- export CHROME_BIN=chromium-browser
script:
- npm run lint
# - npm run e2e
- npm run build -- --prod
after_success:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin;
export REPO=udlepssoftarch/geolearning;
export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`;
docker build -f Dockerfile -t $REPO:$TRAVIS_COMMIT .;
docker tag $REPO:$TRAVIS_COMMIT $REPO:$TAG;
docker push $REPO;
echo "$HEROKU_API_KEY" | docker login --username=_ --password-stdin registry.heroku.com;
docker tag $REPO:$TRAVIS_COMMIT registry.heroku.com/geolearning/web;
docker push registry.heroku.com/geolearning/web;
wget -qO- https://toolbelt.heroku.com/install.sh | sh;
heroku container:release web --app geolearning;
fi