-
Notifications
You must be signed in to change notification settings - Fork 18
/
.travis.yml
27 lines (22 loc) · 1.36 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
language: go
go:
- 1.8
# - tip
before_install:
- export PATH=$PATH:$GOPATH/bin
- export UPLOAD_BINARIES=`test ${TRAVIS_GO_VERSION#go} == "1.8" && test $TRAVIS_PULL_REQUEST == "false" && test -z $TRAVIS_TAG && test $TRAVIS_BRANCH == "master" && echo "true" || echo "false"`
- go get -v -u github.com/kr/godep
install:
- godep go build -v ./...
script:
- godep go test ./...
- test -z "$(go fmt ./...)"
after_success:
- test $UPLOAD_BINARIES == "true" && go get -v -u -d github.com/elasticsearch/logstash-forwarder
- test $UPLOAD_BINARIES == "true" && go get -v -u github.com/mitchellh/gox
- test $UPLOAD_BINARIES == "true" && go get -v -u github.com/tcnksm/ghr
- test $UPLOAD_BINARIES == "true" && gox -build-toolchain -os "darwin linux openbsd windows"
- test $UPLOAD_BINARIES == "true" && (cd $HOME/gopath/src/github.com/elasticsearch/logstash-forwarder && gox -os "darwin linux openbsd windows" -output "$HOME/gopath/src/github.com/digital-wonderland/docker-logstash-forwarder/dist/{{.OS}}_{{.Arch}}_{{.Dir}}")
- test $UPLOAD_BINARIES == "true" && export GOPATH=`godep path`:$GOPATH
- test $UPLOAD_BINARIES == "true" && gox -os "darwin linux windows" -output "dist/{{.OS}}_{{.Arch}}_{{.Dir}}"
- test $UPLOAD_BINARIES == "true" && ghr --username digital-wonderland --repository docker-logstash-forwarder --token $GITHUB_TOKEN --delete --debug latest dist/