-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
38 lines (34 loc) · 1.39 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
language: go
# Force-enable Go modules. Also force go to use the code in vendor/
# These will both be unnecessary when Go 1.14 lands.
env: GO111MODULE=on
# You don't need to test on very old versions of the Go compiler. It's the user's
# responsibility to keep their compiler up to date.
go:
- 1.13.x
git:
depth: 1
install: true
jobs:
include:
- stage: test
before_script:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0
- 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 coverage.out ./...
- 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)
- name: Dockerhub deploy
if: tag IS present
stage: deploy
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker build . -t samtholiya/analyser-service:$(git describe --tags)
- docker build . -t samtholiya/analyser-service:latest
- docker push samtholiya/analyser-service:$(git describe --tags)
- docker push samtholiya/analyser-service:latest