-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
49 lines (42 loc) · 1.44 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
sudo: required
dist: trusty
os: linux
group: stable
language: node_js
node_js: 8.11.1
services:
- mongodb
- rabbitmq
before_install:
- mongo data --eval 'db.dropDatabase();'
- sudo apt-get update
- sudo apt-get install python2.7 git-all pkg-config libncurses5-dev libssl-dev libnss3-dev libexpat-dev libc6-dev -y
install:
- npm install
script:
- travis_wait 30 npm test -- --coverage
after_success:
- FULL_GCR_KEY="-----BEGIN PRIVATE KEY-----\n"$GCR_KEY"\n-----END PRIVATE KEY-----\n"
- sed -i -e "s%\PWD%$FULL_GCR_KEY%g" gcregistry.json
- docker login -u _json_key -p "$(cat gcregistry.json)" https://gcr.io
- rm -rf gcregistry.json
- |
if [ "$TRAVIS_TAG" == "" ]; then
IMAGE_TAG_NAME="latest"
elif [ "$TRAVIS_TAG" != "" ]; then
IMAGE_TAG_NAME="develop"
fi;
- IMAGE_TAG_NAME="latest"
- |
if [ "$TRAVIS_BRANCH" == "master" ]; then
travis_wait 30 docker build -t gcr.io/deep-wares-144610/$TRAVIS_BRANCH/middleware-nem:$IMAGE_TAG_NAME --build-arg RELEASE=latest .
docker push gcr.io/deep-wares-144610/$TRAVIS_BRANCH/middleware-nem:$IMAGE_TAG_NAME
elif [ "$TRAVIS_BRANCH" == "develop" ]; then
travis_wait 30 docker build -t gcr.io/deep-wares-144610/$TRAVIS_BRANCH/middleware-nem:$IMAGE_TAG_NAME --build-arg RELEASE=develop .
docker push gcr.io/deep-wares-144610/$TRAVIS_BRANCH/middleware-nem:$IMAGE_TAG_NAME
fi;
notifications:
email: false
cache:
directories:
- node_modules