forked from golos-blockchain/chain-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
48 lines (41 loc) · 1.3 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
sudo: required
language: cpp
services:
- docker
before_install:
- echo "$TRAVIS_TAG"
- echo "$TRAVIS_BRANCH"
env:
- DOCKERFILE=Dockerfile DOCKERNAME=""
- DOCKERFILE=share/golosd/docker/Dockerfile-test DOCKERNAME="-test"
- DOCKERFILE=share/golosd/docker/Dockerfile-testnet DOCKERNAME="-testnet"
- DOCKERFILE=share/golosd/docker/Dockerfile-mongo DOCKERNAME="-mongo"
matrix:
fast_finish: true
script:
- if [ "$TRAVIS_BRANCH" == "master" ]; then
export DOCKERNAME="latest""$DOCKERNAME";
export EXPORTNAME="$DOCKERNAME";
elif [ -n "$TRAVIS_TAG" ]; then
export DOCKERNAME="$TRAVIS_TAG""$DOCKERNAME";
export EXPORTNAME="$DOCKERNAME";
elif [ "$DOCKERNAME" == "-testnet" ] || [ "$DOCKERNAME" == "-test" ]; then
export DOCKERNAME=develop"$DOCKERNAME";
else
export DOCKERNAME="";
fi
- echo "$DOCKERFILE"
- echo "$DOCKERNAME"
- if [ -n "$DOCKERNAME" ]; then
docker build -t goloschain/golos:"$DOCKERNAME" -f "$DOCKERFILE" .;
fi
after_success:
- echo "$EXPORTNAME"
- docker images
- if [ -n "$EXPORTNAME" ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push goloschain/golos:"$EXPORTNAME";
fi
- if [ "$TRAVIS_BRANCH" == "master" -a "$EXPORTNAME" == "latest" ]; then
bash deploy/deploy.sh;
fi