forked from blakelead/couchbase_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
24 lines (19 loc) · 799 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
language: go
sudo: false
go:
- 1.11.x
services:
- docker
before_install:
- go get github.com/mattn/goveralls
script:
- $HOME/gopath/bin/goveralls -v -service=travis-ci
after_success:
- test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash
- mkdir -p dist && cp -r metrics dist
- CGO_ENABLED="0" GOARCH="amd64" GOOS="linux" go build -a -installsuffix cgo -o dist/couchbase_exporter
- docker login -u "$DOCKER_HUB_ID" -p "$DOCKER_HUB_PASSWORD"
- export REPO=$DOCKER_HUB_ID/couchbase-exporter
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; elif [ "$TRAVIS_BRANCH" == "develop" ]; then echo "devel"; else echo $TRAVIS_TAG; fi`
- echo $REPO:$TAG
- if [ ! -z "$TAG" ]; then docker build -f Dockerfile -t $REPO:$TAG .; docker push $REPO; fi