-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
47 lines (39 loc) · 1.06 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
sudo: required
language: go
go:
- "1.10.3"
services:
- docker
env:
global:
- TAG=$TRAVIS_COMMIT
- DOCKER_REPO=thomasjpfan/docker-scaler
before_install:
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- go env && pwd
install:
- make dep
- docker swarm init
script:
- >
./scripts/coverage.sh &&
make build_image &&
make deploy_test &&
make integration_test
after_script:
- make undeploy_test
after_success:
- ./scripts/coverage.sh coveralls
- >
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
if [ "$TRAVIS_BRANCH" == "master" ]; then
echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin
docker tag DOCKER_REPO:$TAG DOCKER_REPO:latest
docker push DOCKER_REPO:latest
elif [ "$TRAVIS_BRANCH" == "$TRAVIS_TAG" ]; then
echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin
docker tag DOCKER_REPO:$TAG DOCKER_REPO:$TRAVIS_TAG
docker push DOCKER_REPO:$TRAVIS_TAG
fi
fi