forked from prometheus-msteams/prometheus-msteams
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
54 lines (45 loc) · 1.21 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
42
43
44
45
46
47
48
49
50
51
52
53
language: go
branches:
only:
- master
- /^v.*$/
- /^issue-\d+/
go:
- "1.11.x"
sudo: false
services:
- docker
install:
- go get github.com/golang/lint/golint
- golint -set_exit_status ./...
- make dep
script:
# Code coverage and testing
- make coverage
- bash <(curl -s https://codecov.io/bash)
# Docker build and deployment
# Push only if:
# - triggered by a push to master
# - triggered by a push to a tag
# - not triggered by a pull request
# https://docs.travis-ci.com/user/environment-variables/
- |
export VERSION=${TRAVIS_TAG:-"latest"}
make docker VERSION=${VERSION}
echo ${DOCKER_PASSWORD} | docker login --password-stdin -u ${DOCKER_USER}
if [[ (! -z ${TRAVIS_TAG} || ${TRAVIS_BRANCH} == "master") && ${TRAVIS_PULL_REQUEST} == false ]]; then
make docker-push VERSION=${VERSION}
elif [[ ${TRAVIS_PULL_REQUEST} == "true" ]]; then
make docker-push VERSION=${TRAVIS_PULL_REQUEST_BRANCH}
fi
make darwin VERSION=${VERSION}
deploy:
provider: releases
api_key: $GITHUB_OAUTH_TOKEN
file:
- ./bin/prometheus-msteams-darwin-amd64
- ./bin/prometheus-msteams-linux-amd64
- ./bin/shasum256.txt
skip_cleanup: true
on:
tags: true