-
Notifications
You must be signed in to change notification settings - Fork 133
/
.travis.yml
77 lines (68 loc) · 4.2 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
language: go
sudo: required
services:
- docker
env:
global:
- APP_NAME=shell2http
- CURRENT_GO_VERSION="1.9"
- DOCKER_USERNAME=msoap
- secure: vO3gq16EiNtNXeNrZM6T2r4ysqWtxv9S1AphV1DMQKfpo3f827qMBYZ+HyeWD7jFFvb9lJxmzf2KXh/zSWSRoAkFtmcM8ENbG+AdQb1JNNIyrkb3hvUzU1Qkia8SqEc0fBysTtiyCKNDK6Cp1+xOSZ+6icVGUh4BtiEv2DLTCcN8U3IgSxu5Dm4iR0nlTeTLWV5wORFaOHNbuh/aQVtyjMmm8hsZDpcobLZU3x4XvyrIwqbbkvNLR/ctr49nIyGYySqeJ1pJRNeELpWsItHExagn9Xa8B2+LTHd59+dyrifmJaYCsv+d/j5qxHqgl4ibBY8/cgNI/+3cb7/41o9sTLVCwAJFU9zWG/FkSykJ2EXd0vnDNs0cbZ8S+xxjpcQZx1L3op1c6YSt6/0b3yi7CnIACJXLDqddXutR3is54QKQ56VE6eOYiOeS2ALsJaWJR9Obi/4wHiH7w+ySFmz+BRNACWBkfdHy3P9nIVh9VqEd33bDpWeAZK+0ROprePPOAdJi60c5uflcjT2e0Vz5FlXJdOX71nPyPdsivMAGUaKC3Nxuodxs6QvMh1XtbcTozU+6ZwU+I8Q/66g9/fVPaF/sJl4aZuZQEvXCpi3GRhRhcZHsihOXal+QIXlsI+13bkKYcJl7lKBIa3yI7Yh8sx3Zp34rtv54WRzV9kOkWqo=
- secure: pEX6V6S5gdN0MEsdJOZ/xHn82PFEwCQunOoC2QXt6L8UK1NkJiz59ZV4g1RMh2YPoUA34KPKNX73PgMSINVrh/aHU1LhguPGfpOnnJDgXnynMDWccqAKPviOoFpQ+bfZ00MYZiXsSAwMx1J8FHFkgtUE9hAThY+25OcPQWogD9Bgv283qa8CG5w67gJstS6dyd9T5T5EafQBUUJDZNoEdNQfHDnAPZ4pfCuoNwfgqUYMsrH+pt5syci5+o7/XH+ALl7JPTKtUrzKFjcaHqJGQZ+uwi/CzIUWZBwUzNI5DZwn4xoH6GDYd+ehnb8A8RxPNq29RFinsBO4bSl7ppcUpnL+ZJUn2z+Z9Bu4vLpA5mothIMeFpketHl1mNc9sbSBIwZ2aXB9kyeTqaXDeMGI0KNMAJzbr20l7PYlKsJz4RpwSsZ8fsPo7tyvQuja976+Vuyni+GCr0FQs9xr7bRnPEeMP6l1ea98L7lCmvXF/YyCCYl8lICASYaFgGb0qYtxHUIpX2HyXWBz+z5633dBAtY8emxzMypR35bpOjsSg5eVQoJ3IGN+5xOq61TbDFi3vP0nYas6AgCdmykH0o3OkKBey4l0MgvVLhyY7yqjAz8Xf2xfhnu8aLmVqyVv7OiqLLUJHiSlpp9BupYK9xAXoX9im7QrykNf4io1vFciRVg=
go:
- 1.8.x
- 1.9.x
- master
matrix:
fast_finish: true
allow_failures:
- go: master
before_install:
- go get github.com/mattn/goveralls
- go get github.com/philwinder/gocoverage
- go get github.com/kisielk/errcheck
install: go get -t ./...
script:
- go test -race -v ./...
- go vet ./...
- errcheck ./...
- diff <(gofmt -d .) <(echo -n "")
- if [[ $TRAVIS_GO_VERSION =~ $CURRENT_GO_VERSION ]]; then
gocoverage && goveralls -coverprofile=profile.cov -service=travis-ci || true;
fi
after_success:
- if [[ $TRAVIS_GO_VERSION =~ $CURRENT_GO_VERSION ]] && [[ $TRAVIS_BRANCH == "master" || -n $TRAVIS_TAG ]] && [[ $TRAVIS_EVENT_TYPE == "push" ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker login -u="$QUAY_USERNAME" -p="$QUAY_PASSWORD" quay.io &&
docker build -t $DOCKER_USERNAME/$APP_NAME:latest . &&
docker tag $DOCKER_USERNAME/$APP_NAME:latest quay.io/$DOCKER_USERNAME/$APP_NAME:latest &&
docker push $DOCKER_USERNAME/$APP_NAME:latest &&
docker push quay.io/$DOCKER_USERNAME/$APP_NAME:latest;
if [[ -n $TRAVIS_TAG ]]; then
docker tag $DOCKER_USERNAME/$APP_NAME:latest $DOCKER_USERNAME/$APP_NAME:$TRAVIS_TAG &&
docker tag $DOCKER_USERNAME/$APP_NAME:latest quay.io/$DOCKER_USERNAME/$APP_NAME:$TRAVIS_TAG &&
docker push $DOCKER_USERNAME/$APP_NAME:$TRAVIS_TAG &&
docker push quay.io/$DOCKER_USERNAME/$APP_NAME:$TRAVIS_TAG;
fi;
fi
before_deploy:
- curl -sSL https://raw.githubusercontent.com/msoap/etc/master/golang-cross-build/golang-cross-build.sh > $GOPATH/bin/golang-cross-build.sh
- chmod 700 $GOPATH/bin/golang-cross-build.sh
- gem install --no-ri --no-rdoc fpm
- golang-cross-build.sh $APP_NAME
- ls -l *.zip *.tar.gz *.deb
deploy:
provider: releases
api_key:
secure: dXAy5WWWVozf+prMJNjQT6s4JqAXZEyOZ+LeaBzz8k7WZzCvHaLg+qdIpXbIL0G/hc7hW9WEhj/apcjiodwPhqKjy52dw3bUclHqUxxR5ZvgyZyb7qyyLoPqDtygHgGMX+UANgkMTUIM3auP/W6jvmV5mc7ddTZah+z+l542J6AdDOs+m97dlqNLdlz5AdCr5uY0O2sIsmpD4WFxINsdcG67Lj6V9HK8fzlCz0aGeKvcapgF1r4iXxWxvwSGMJwdljYKGyX2wm5Sp2Q7IklX/zNPAPJZtthUvbaaDUMkmYjb6YcAPmFZ1IhtFkpurNzNGfKCSz7784ZEf1b+dDYLNAKwv6hG1YKLadFoplecaH0xLcYwBZvwq9pDaJpX20I5sbNQDyEOCjrBaxB1RyCr/m9m8tOXZzfn6YIUHAbimhL4g98smQ797fQn4/zquSeKkqF2mMA5v5hLdXI2snwK/e2zDxTCwpw4NNyxjY6PgXO61vL4EE8Xq6nl+rKDZ7B+BXWHmP5kxuxHHVpYZPKUnQUmpbUkD62RM5hZbJ6+h07WF3wVvgFc+l8aNK8W+uWff5OZBbyV7mWdfpHtxVR0xSG/6eGIiCVJ6cFLyjV2JRQHk9x+aZKSEErfkuYawyt+tIl7OtsqBNBtYHE4ARgvwb7uPbX4EgTpcQmOsRCNBsQ=
file_glob: "true"
file:
- "*.zip"
- "*.tar.gz"
- "*.deb"
skip_cleanup: true
on:
tags: true
branch: master
condition: $TRAVIS_GO_VERSION =~ $CURRENT_GO_VERSION
repo: msoap/$APP_NAME