-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
51 lines (43 loc) · 1.56 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
50
51
sudo: required
dist: trusty
os: linux
group: stable
language: node_js
node_js: 7.6.0
services:
- mongodb
- rabbitmq
before_install:
- export LABORX_USE_AUTH=1
- 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:
- 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-ethereum:$IMAGE_TAG_NAME --build-arg RELEASE=latest --build-arg GITHUB_API_KEY=$GITHUB_API_KEY .
docker push gcr.io/deep-wares-144610/$TRAVIS_BRANCH/middleware-ethereum:$IMAGE_TAG_NAME
elif [ "$TRAVIS_BRANCH" == "develop" ]; then
travis_wait 30 docker build -t gcr.io/deep-wares-144610/$TRAVIS_BRANCH/middleware-ethereum:$IMAGE_TAG_NAME --build-arg RELEASE=develop --build-arg GITHUB_API_KEY=$GITHUB_API_KEY .
docker push gcr.io/deep-wares-144610/$TRAVIS_BRANCH/middleware-ethereum:$IMAGE_TAG_NAME
fi;
notifications:
email: false
cache:
directories:
- node_modules