forked from chrislusf/glow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
40 lines (33 loc) · 1.09 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
sudo: required
os:
- linux
- osx
# - windows
language: go
go:
- 1.10.x
- 1.11.x
- tip
services:
- docker
env:
- GOMAXPROCS=4 GORACE="halt_on_error=1"
before_install:
- echo "$TRAVIS_GO_VERSION"
- export PATH=/home/travis/gopath/bin:$PATH
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install bzr ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install docker ; fi
install:
- go get ./...
script:
- go test -race -timeout=90s ./...
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build .
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -f Dockerfile -t $DOCKER_REPO:$TRAVIS_COMMIT . ; fi
after_success:
- if [[ "$TRAVIS_GO_VERSION" == "1.5" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$TRAVIS_BRANCH" == "master" ]]; then
docker login -e $DOCKER_EMAIL -u $DOCKER_USERNAME -p $DOCKER_PASSWORD;
docker tag $DOCKER_REPO:$TRAVIS_COMMIT $DOCKER_REPO:latest;
docker tag $DOCKER_REPO:$TRAVIS_COMMIT $DOCKER_REPO:travis-$TRAVIS_BUILD_NUMBER;
docker push $DOCKER_REPO;
fi