This repository has been archived by the owner on Nov 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
/
.travis.yml
118 lines (104 loc) · 3.59 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
language: go
go:
# NB: order matters - matrix items that don't specify will use the
# first value (ditto for `os` below).
# NB: release condition below also references (one) of the values in
# this list. Update there too!
- 1.15.x
- 1.14.x
os:
- linux
- osx
env:
global:
- PATH=$PATH:$GOPATH/bin
- VERSION="${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID}"
- GO_LDFLAGS="-w -s"
- MINIKUBE_WANTUPDATENOTIFICATION=false
- MINIKUBE_WANTREPORTERRORPROMPT=false
- MINIKUBE_HOME=${HOME}
- CHANGE_MINIKUBE_NONE_USER=true
- GINKGO_FLAGS="--randomizeAllSpecs --randomizeSuites --failOnPending --trace --race --progress --compilers=2 --nodes=2"
matrix:
include:
- env: DO_INTEGRATION_TEST=1 INT_KVERS=v1.16.8
fast_finish: true
services:
- docker
addons:
apt:
packages:
- wget
- ca-certificates
install:
- (cd /; GO111MODULE=on go get github.com/jteeuwen/go-bindata/go-bindata@6025e8de665b31fa74ab1a66f2cddd8c0abf887e)
- |
if [ "$DO_INTEGRATION_TEST" = 1 ]; then
if ! which minikube; then
wget -O minikube \
https://storage.googleapis.com/minikube/releases/v1.9.2/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
export GO111MODULE=on
GINKGO_VERSION=$(go list -f '{{.Version}}' -m github.com/onsi/ginkgo)
(cd /; go get github.com/onsi/ginkgo/ginkgo@$GINKGO_VERSION)
fi
script:
- make generate
- |
if ! git diff --exit-code --name-only; then
git diff
echo 'Run "make generate" and add generated changes to this PR'
exit 1
fi
- make all test vet
- >
ldd ./kubecfg || otool -L ./kubecfg || :
- ./kubecfg help
- ./kubecfg version
- |
if [ "$DO_INTEGRATION_TEST" = 1 ]; then
minikube update-context
minikube status
make integrationtest GINKGO="ginkgo $GINKGOFLAGS"
fi
after_script: set +e
before_deploy:
- echo OS_NAME=$TRAVIS_OS_NAME GO_VERSION=$TRAVIS_GO_VERSION
- EXE_NAME=kubecfg-$(go env GOOS)-$(go env GOARCH)
- cp kubecfg $EXE_NAME
- ./$EXE_NAME version
- >
size $EXE_NAME || :
deploy:
api_key:
secure: "fzKvrCO9cifb7mw5Pu89lJ5wX6DF7PXKH+gy2Ca13uEGITOHI+Co9gCwm15nvxkm2k/hpRwD5NmC2kcbP/ludWmyd1okd304M2vh3PZsB1iZq5HGPCMRnU0dAANRVgsqOIyduSzV733WPuu2jT1CrkFcHhava1vheVN0+pR3h5oql1BLVNidr5TNkIvkRXi37sex939MqcNONNzBu1afQwOXx6h2nGAtzFR6+L6X4BHzkTUZSJ+Rt8lvsrFKc75RRxYmroeFEYMwPAcLr7xz2A0ABHhdTmHS7n3gwmHo9rBAa92TfiVFEUux6RDdgkn6RvqlDOW8XKS3eVeTZaBXL/YkTeaNIczQYgSGMfvBRlYPowIC9UdxexmOAhYPWajSJFSMomdLQsZLHnFrxSsdpj4udC04X4EeQto5HnHERbdz7q97IMdvjI53xfEOW9fgwpsc3lLN/BXybzqVWFQxfvQnNZYQ9ZU30lJ9w8WVsoTb8E3B9w/nf3v7y1+33KDQ/aJnHB72seG/HYypQZg0Ob35yC7CsTN/va+UX/Bh2A1fCa5Bp6o1OCEWq0tAxwL7P7HDKMBfUZECwAodMs5VpHMxqdKaDUZh5OATGBk7Ite3BWsjugdGqwEh9fzXFQN1Rmz3cFYZqYYZ8mtQUeKQ9omVGpqh2JkHlIEGRznzw9c="
file: $EXE_NAME
on:
condition: x$DO_INTEGRATION_TEST = x && ${TRAVIS_GO_VERSION}.0 =~ ^1\.15\.
tags: true
provider: releases
skip_cleanup: true
cache:
directories:
- $GOPATH/pkg
- $GOPATH/bin
- $HOME/.minikube/cache
branches:
only:
- master
- main
# release tags
- /^v\d+\.\d+\.\d+.*$/
notifications:
email:
on_success: never