-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
30 lines (28 loc) · 1.1 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
sudo: required
services:
- docker
install:
- docker build --target builder -t pm-kyc-service_builder .
- docker build -t pm-kyc-service .
script:
- docker run -e TRAVIS=$TRAVIS -e TRAVIS_JOB_ID=$TRAVIS_JOB_ID -ti pm-kyc-service_builder /bin/sh
-c "cd /go/src/github.com/gnosis/pm-kyc-service/tests && go test -v"
after_success:
- |-
# Create Docker image if branch master or develop and not on pull requests
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
echo "Pushing to Docker-hub version generated from branch $TRAVIS_BRANCH";
if [ "$TRAVIS_BRANCH" == "master" ]; then
echo "Pushing image staging...";
docker tag pm-kyc-service gnosispm/pm-kyc-service:staging;
docker push gnosispm/pm-kyc-service:staging;
elif [ "$TRAVIS_BRANCH" == "develop" ]; then
echo "Pushing image develop...";
docker tag pm-kyc-service gnosispm/pm-kyc-service:develop;
docker push gnosispm/pm-kyc-service:develop;
fi
echo "The image has been pushed";
else
echo "There's no need to push the image to Docker-hub";
fi