-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
38 lines (33 loc) · 2.48 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
sudo: required
language: go
go_import_path: github.com/bosh-prometheus/shield_exporter
services:
- docker
jobs:
include:
- stage: Run tests
script: make test
- stage: Build docker image
env:
- DOCKER_IMAGE_NAME=boshprometheus/shield-exporter
- secure: aBLGM954OcqJ63XyY7nGKWjBns4dLpr5Mtp0vRRmE+psY2DHtgIuCQhb/+ikF1euXHRJYl7GcRPO/6HiwsICwqfT9itdPtwHISwogfO/keMJk0v6+F9AFk9Lrw0An5iU7CRm9GYQRXKDPt//FnYxCH7S2S9c81gUW6DJX1RANbXFQ183Ot7UiNyYOj190Cz1s7kg22QK8TcYqGeOMwZiSv7stxG84QQdhNsJ/U5duOMg8g+fY99xJ580b4N1TU64IZuRrHcaeKxH+WnWDLsbFAMdBPQ3/x3SAr7LY4G8o7OS8pgPj1fOTPEaefkOYAcbsVgAH8WcMorFq1D3oTIb65WP0i3eCGiZEl7ghrmcJXrTTOuiObl9PVVZnotJBGaXFQGmjnd7+HmjDkt7BynlSHcaKxB+7hfDKzfrY8LcTtOxUgX34CR0GW8VmkQ/GtM9BgkWQoXUUocuQvWX4jHn3jazUlC5G1gmDmYyb161Ox6IG8cIB4aCUI7KRrWWVD6KYCDTFeKLm3MRRDu77vd87uMvVUWyLq48rV6nHdTKD8A9KdZGveDON2ZsBDceF+MQe4KC6COb1oAlojHYwcqsfWk9F8/URVE0PpJoyBqhrEnuSbTss+FID0UoVvf0Q5RelAoXGis4o98FJEd08rd4p5vZdHhfwWHFl+BusVZQ29E=
- secure: nFiRb0QL4AbF+/rFyQ2pNlUBMpW0VHQH4tTr6QeBb+STqSZghLQ8bUEPH2CinA5feVjg3i+NEWcJVmD2diSOuIAS7txKEQLfgkmDm3DaygAY3/xufn6ayIsEXMjJu9YpR3FarwVP8kTrxKs3KG5uPOWEqnCIhufa1f90lrbLiZoDj1wcP6Dp55yarVQdQ6zt2bAgttcW/PGYEsv9FnL8Pmf3SJnlerVWGHmWl7Vcj249g9P0GCVTRMtCckXqVTzy7qI7p7x0vC5rLIYKzfGaK/CYH4c/N+mIvqOwiSQfGbAVUSAwSlrAEibd3OPIJ7Q92QzS+6I1Tzo3zvT+iWbFLH5aesf9hxgfSqn8sP6izSVIF7hd+hVHc+tMZln4GUgZn002RRq4KT5S9Grvr7QIiDqYHbft/tLmbp1biwRCPC+pAU+t3+zZNmI3LZYJfLB+b9S5aNuV6+xOBPw9z6/FgDlEQuTKwFRBSSGhxsUxjgUQsWS30CXpbIOnU/gh40NfXWbDNSv2vFmjyJt06bAHe2OgHEntfo4Qi95ezgPw4Y+I5SWX+uDL6OwdUDcymCnfr63UGeJafIO9FRehV2nNAXG8mifAgDDqxGj5C3lyQIPJV6yvPUxgBoMN7V+Xfs1tnlfPRj0E10y4pkV4y3pvAes2xFmPgC+1EEP7jw0MC40=
script:
- make crossbuild
- ln -s .build/linux-amd64/shield_exporter shield_exporter
- |
if [ -n "$TRAVIS_TAG" ]; then
make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$TRAVIS_TAG
else
make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
fi
- |
if [[ "$TRAVIS_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
docker tag "$DOCKER_IMAGE_NAME:$TRAVIS_TAG" "$DOCKER_IMAGE_NAME:latest"
fi
- docker images
- |
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
docker push $DOCKER_IMAGE_NAME
fi