forked from chrislusf/glow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
41 lines (34 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
31
32
33
34
35
36
37
38
39
40
41
sudo: required
os:
- linux
- osx
- windows
- freebsd
language: go
go:
- 1.5
- 1.6
- 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