This repository has been archived by the owner on Mar 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
152 lines (135 loc) · 4.29 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
language: go
go:
- 1.8.x
os:
- linux
env:
global:
- PATH=$PATH:$GOPATH/bin
- VERSION="${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID}"
- EXTRA_GO_FLAGS_TEST="-race"
- MINIKUBE_WANTUPDATENOTIFICATION=false
- MINIKUBE_WANTREPORTERRORPROMPT=false
- MINIKUBE_HOME=${HOME}
- CHANGE_MINIKUBE_NONE_USER=true
# Frequent jsonnet_cgo crashes with xcode7.3 (default)
osx_image: xcode8.3
matrix:
include:
- env: TARGET=x86_64-linux-musl EXTRA_GO_FLAGS_TEST=""
go: 1.8.x
- env: DO_INTEGRATION_TEST=1 INT_KVERS=v1.7.0
# cgo requires golang >= 1.8.1 (or other workarounds) on recent
# osx/xcode - see https://github.com/golang/go/issues/19734
# 'go test' also hangs repeatably on go-1.8.3/MacOS ?
- os: osx
go: 1.8.x
fast_finish: true
allow_failures:
# Let us know if/when 'go test' works again on MacOS..
- os: osx
go: 1.8.x
services:
- docker
addons:
apt:
packages:
# Most of these are musl-cross dependencies
- wget
- patch
- git-core
- gcc
- g++
- make
- gawk
- bzip2
- gzip
- xz-utils
- ca-certificates
- libgmp-dev
- libmpfr-dev
- libmpc-dev
before_install:
- set -e
- |
if [ -n "$TARGET" -a ! -d "$HOME/cross/$TARGET/bin" ]; then
pushd /tmp
git clone --depth=1 https://github.com/GregorR/musl-cross.git
cd musl-cross
echo CC_BASE_PREFIX=$HOME/cross >> ./config.sh
if ! ./build.sh > build.log; then
tail -100 build.log
exit 1
fi
popd
fi
- |
if [ -n "$TARGET" ]; then
PATH=$PATH:$HOME/cross/$TARGET/bin
export CC="$TARGET-gcc"
export CXX="$TARGET-g++"
export GO_LDFLAGS='-linkmode external -extldflags=-static'
fi
install:
- go build -i -ldflags "$GO_LDFLAGS" .
- |
if [ "$DO_INTEGRATION_TEST" = 1 ]; then
if ! which minikube; then
wget -O minikube \
https://storage.googleapis.com/minikube/releases/v0.21.0/minikube-$(go env GOOS)-$(go env GOARCH)
install -m 755 minikube $GOPATH/bin/minikube
fi
if ! which kubectl; then
wget https://storage.googleapis.com/kubernetes-release/release/$INT_KVERS/bin/$(go env GOOS)/$(go env GOARCH)/kubectl
install -m 755 kubectl $GOPATH/bin/kubectl
fi
mkdir -p $HOME/.kube
touch $HOME/.kube/config
sudo -E $GOPATH/bin/minikube start --vm-driver=none \
--extra-config apiserver.Authorization.Mode=RBAC \
--kubernetes-version $INT_KVERS
go get github.com/onsi/ginkgo/ginkgo
fi
script:
- make VERSION="$VERSION" EXTRA_GO_FLAGS="$EXTRA_GO_FLAGS_TEST" test
- make vet
- rm -f ./kubecfg && make VERSION="$VERSION"
- >
ldd ./kubecfg || otool -L ./kubecfg || :
- ./kubecfg help
- ./kubecfg version
- |
if [ "$DO_INTEGRATION_TEST" = 1 ]; then
minikube update-context
minikube status
make VERSION="$VERSION" EXTRA_GO_FLAGS="$EXTRA_GO_FLAGS_TEST" integrationtest
fi
after_script: set +e
before_deploy:
- echo TARGET=$TARGET OS_NAME=$TRAVIS_OS_NAME GO_VERSION=$TRAVIS_GO_VERSION
- EXE_NAME=kubecfg-$(go env GOOS)-$(go env GOARCH)
- cp kubecfg $EXE_NAME
- strip $EXE_NAME && ./$EXE_NAME version
- >
size $EXE_NAME || :
deploy:
api_key:
secure: "T/LpWZSgeqWBgY3mUNeej55n8TbZZM7UgrHl7pej1CE2cs6YGcfyog3peiXvCcVF9NhGsm6eTXZQeFxsuWgMbWYeqlBnMkHNPPqdNpeRFgY0TkFZXHZLexfqTo2MLgrZiJ+bZl8wZnTTXukieGeLE37ugkBJyceLyfqIaxwRlpDzKPn8XtIqOMOwMq0aeUA8wjSSpuWkuwlGWKwJtI48BNExZZ1FRpPHQdAZjX6zEPT2SuRaACZdoX+3k/Fr91H6O9TplE4q5eCpEdd3y7BGGtMm3WA70SxYIZPGzfwaALGja5BapZr9Eui6ppyPGesQ8zV+zNtOsnK5Phj3QUj8M+v4BmJbxbPyhAIWmFiDlutgwZUkXI+R+SXONy1/LTuLLNSJ9WPQsC9gL09FGQmg+X0s7VpJVWxD8FScY0DJ4/bNLgeWnzwT2YTsduDktqevMpetxJWZGVQx3EN595JJKlZGtE8PouzVm7sRQEfe3Jd0XIcPfj5AV5trEBDjgHZSnU4qa9G9RdUZfswVp+R7SEwoTwEIEyOpFAwi9Qg5wkCAZFU2+86LQOLYH0Pm38//RxSXJEF1abkEb0Y/awz6KKlGBK3z1VSXvK3LQ8r9SwF2h15rD74O1mGM8Mjbs+mJXPxKpCq+BslskRYur3F8tRx45pwr8Ly9dppZd2rrswI="
file: $EXE_NAME
on:
condition: ( $TARGET = x86_64-linux-musl || $TRAVIS_OS_NAME = osx ) && ${TRAVIS_GO_VERSION}.0 =~ ^1\.8\.
tags: true
provider: releases
skip_cleanup: true
cache:
directories:
- $GOPATH/pkg
- $HOME/cross
branches:
only:
- master
# release tags
- /^v\d+\.\d+\.\d+.*$/
notifications:
email:
on_success: never