-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
32 lines (27 loc) · 897 Bytes
/
.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
language: go
go:
- '1.9'
sudo: required
services: docker
# git:
# submodules: false
# before_install:
# - git submodule init
# - git submodule update --depth=22
# install:
# - pip install -r requirements.txt
script:
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-s -w'
after_success:
#- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; depresed
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- docker build -t $TRAVIS_REPO_SLUG .;
- docker push $TRAVIS_REPO_SLUG:latest;
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker tag $TRAVIS_REPO_SLUG $TRAVIS_REPO_SLUG:dev;
docker push $TRAVIS_REPO_SLUG:dev;
fi
- if [ $TRAVIS_TAG ]; then
docker tag $TRAVIS_REPO_SLUG $TRAVIS_REPO_SLUG:$TRAVIS_TAG;
docker push $TRAVIS_REPO_SLUG:$TRAVIS_TAG;
fi