-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
37 lines (33 loc) · 1.24 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
language: go
env:
- GO111MODULE=on
git:
depth: 1
install: true
jobs:
include:
- stage: test
before_script:
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- go test -v -race -coverprofile c.out ./...
- ./codecov.sh
- golangci-lint run
after_script:
- ./cc-test-reporter -d after-build -p go-open-registry --exit-code $TRAVIS_TEST_RESULT
- bash <(curl -s https://codecov.io/bash)
- stage: release tagged version
if: tag IS present
script:
- echo "Travis tag $TRAVIS_TAG"
- export ALIAS=`echo $TRAVIS_COMMIT | cut -c 1-7`
- export TAG=`echo $TRAVIS_TAG | sed 's/\./-/g' | sed 's/.*/v&/'`
# Build and release to Docker Hub
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- export REPO=$DOCKER_REPO
- docker build -f Dockerfile -t $REPO:$TRAVIS_TAG .
- docker tag $REPO:$TRAVIS_TAG $REPO:latest
- docker push $REPO:$TRAVIS_TAG