Permalink
80 lines (79 sloc) 2.73 KB
language: go
install: true
sudo: required
addons:
apt:
packages:
- rsyslog
- xmlsec1
- rpm
# test stage automatically added for each go version
go:
- 1.11.x
- master
# script used in the automatically added test stage
script:
- 'if [ "${JOB}" = "test" ]; then make race; fi'
- 'if [ "${JOB}" = "leakdetector" ]; then make leakdetector; fi'
- 'if [[ "${JOB}" == "bench" && "${TRAVIS_PULL_REQUEST}" == "false" ]]; then while true; do echo .; sleep 30; done & ./misc/bench.sh; fi'
- 'if [ "${JOB}" = "gometalinter" ]; then while true; do echo .; sleep 30; done & if [ "${TRAVIS_EVENT_TYPE}" = "push" ] && [ "${TRAVIS_BRANCH}" = "master" ]; then make lint; else make metalint; fi; fi'
- 'if [ "${JOB}" = "checkhandlers" ]; then ./misc/check-handlers.sh; fi'
- 'if [ "${JOB}" = "checkevents" ]; then ./misc/check-events.sh; fi'
- 'if [ "${JOB}" = "checkapidocs" ]; then make check-api-doc; fi'
- 'if [ "${JOB}" = "validateapispec" ]; then make validate-api-spec; fi'
- 'if [ "${JOB}" = "validatecodegen" ]; then ./hack/verify-codegen.sh; fi'
env:
global:
- GOARCH=amd64
- GO_FOR_RELEASE=1.11
- IMAGE_NAME=tsuru/api
matrix:
- JOB=test
- JOB=bench
- JOB=leakdetector
- JOB=gometalinter
- JOB=checkhandlers
- JOB=checkevents
- JOB=checkapidocs
- JOB=validateapispec
jobs:
fast_finish: true
allow_failures:
- go: master
exclude:
- go: master
env: JOB=bench
- go: master
env: JOB=gometalinter
- go: master
env: JOB=checkhandlers
- go: master
env: JOB=checkevents
- go: master
env: JOB=checkapidocs
- go: master
env: JOB=validateapispec
- go: master
env: JOB=validatecodegen
include:
- stage: deploy
script:
- CGO_ENABLED=0 go build -ldflags "-X github.com/tsuru/tsuru/cmd.GitHash=`git rev-parse HEAD`" ./cmd/tsurud/
- curl https://raw.githubusercontent.com/tsuru/push-to-docker/master/push.sh | bash
env: JOB=docker hub
- script: if [ -n "$TRAVIS_TAG" ]; then curl -sL https://raw.githubusercontent.com/tsuru/push-to-packagecloud/master/push.sh | PACKAGE_NAME=tsuru-server bash; fi
env: JOB=package cloud
- stage: integration-check
script: ./misc/trigger-integration.sh
notifications:
email:
on_success: change
on_failure: always
slack:
rooms:
- secure: QJe4k18ACRUP4CDo245vBFu1hpVlcR3JPWjT7NL/vAE/Y5KDn5pNXIREPYIx9F/f8lvjF2RrQxjApeUujRh1PPt2Q53JulvaDCfM5a5SYnk5yoqu3ynlfqU4AOTDa6kzoJ3K4M9X8JhMpOtr3+IOPbwV88FjPvwviZN4p0L/0wc=
- secure: PUf33dfseOSrtp8Eoxx7cZoaR+O2zwJ3V++2k3zBXlhZRIntRdyoiZlax2NlKVGPgNMtT1WCQzufGVmvF1GVkkUC+c94wkEG8Qxzzwrcp476+VSfQSla95wFNuAjn0tuhqHommw9CncVUAF+2pfycPR/fmxDfgQaQTL3dsHy66E=
services:
- redis
- docker
- mongodb