forked from bitnami-labs/sealed-secrets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
174 lines (154 loc) · 5.54 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
language: go
go:
- '1.13'
- '1.12'
services:
- docker
os:
- linux
- osx
dist: xenial
env:
global:
- PATH=$PATH:$GOPATH/bin
- CONTROLLER_IMAGE_NAME=quay.io/bitnami/sealed-secrets-controller
- CONTROLLER_IMAGE=${CONTROLLER_IMAGE_NAME}:${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID}
- MINIKUBE_WANTUPDATENOTIFICATION=false
- MINIKUBE_WANTREPORTERRORPROMPT=false
- MINIKUBE_HOME=${HOME}
- CHANGE_MINIKUBE_NONE_USER=true
- KUBECONFIG=${HOME}/.kube/config
matrix:
include:
- env: INT_KVERS=v1.16.0 INT_SSC_CONF=controller.yaml
- env: INT_KVERS=v1.15.4 INT_SSC_CONF=controller.yaml
- env: INT_KVERS=v1.14.1 INT_SSC_CONF=controller.yaml
# keep 1.13 until kops moves on
- env: INT_KVERS=v1.13.5 INT_SSC_CONF=controller.yaml
addons:
apt:
packages:
- wget
- ca-certificates
before_install:
- set -e
install:
- go build -i ./...
- |
if [ "$INT_KVERS" != "" ]; then
v=1.3.1
if ! which minikube-$v; then
wget -O $GOPATH/bin/minikube-$v \
https://storage.googleapis.com/minikube/releases/v$v/minikube-$(go env GOOS)-$(go env GOARCH)
chmod +x $GOPATH/bin/minikube-$v
fi
ln -sf minikube-$v $GOPATH/bin/minikube
v=$INT_KVERS
if ! which kubectl-$v; then
wget -O $GOPATH/bin/kubectl-$v https://storage.googleapis.com/kubernetes-release/release/$v/bin/$(go env GOOS)/$(go env GOARCH)/kubectl
chmod +x $GOPATH/bin/kubectl-$v
fi
ln -sf kubectl-$v $GOPATH/bin/kubectl
mkdir -p $(dirname $KUBECONFIG) $HOME/.minikube
touch $KUBECONFIG
sudo -E $GOPATH/bin/minikube start --vm-driver=none \
--extra-config=apiserver.authorization-mode=RBAC \
--kubernetes-version $INT_KVERS
sudo chown -R travis: /home/travis/.minikube/
go get github.com/onsi/ginkgo/ginkgo
fi
- |
v=0.12.0
if ! which kubecfg-$v; then
wget -O $GOPATH/bin/kubecfg-$v https://github.com/ksonnet/kubecfg/releases/download/v$v/kubecfg-$(go env GOOS)-$(go env GOARCH)
chmod +x $GOPATH/bin/kubecfg-$v
fi
ln -sf kubecfg-$v $GOPATH/bin/kubecfg
script:
# We want to support both go.mod aware builds and legacy builds.
# Instead of adding more combinations to the build matrix,
# we're going to use go 1.13 for the go.mod aware build
# and test the legacy build with go 1.12
- export USE_GO_MOD=no
- |
if [[ ${TRAVIS_GO_VERSION}.0 =~ ^1\.13\. ]]; then
export USE_GO_MOD=yes
make vet
fi
- make
- make test
- make kubeseal-static
- EXE_NAME=kubeseal-$(go env GOOS)-$(go env GOARCH)
- cp kubeseal-static $EXE_NAME
- ./$EXE_NAME --help || test $? -eq 2
- |
if [ "$TRAVIS_OS_NAME" = linux ]; then
make controller.yaml controller-norbac.yaml CONTROLLER_IMAGE=$CONTROLLER_IMAGE IMAGE_PULL_POLICY=Never
fi
- |
if [ "$INT_KVERS" != "" ]; then
minikube update-context
minikube status
while ! kubectl cluster-info; do sleep 3; done
kubectl create -f $INT_SSC_CONF
kubectl rollout status deployment/sealed-secrets-controller -n kube-system -w
make integrationtest CONTROLLER_IMAGE=$CONTROLLER_IMAGE GINKGO="ginkgo -v --randomizeSuites --failOnPending --trace --progress --compilers=2 --nodes=4"
fi
# integration tests required Never pull policy, but release artifacts can't have that
# TODO(mkm): cleanup this.
- |
if [ "$TRAVIS_OS_NAME" = linux ]; then
rm -f controller.yaml controller-norbac.yaml
make controller.yaml controller-norbac.yaml CONTROLLER_IMAGE=$CONTROLLER_IMAGE
fi
- rm -f kubeseal-static
- GOOS=windows GOARCH=amd64 make kubeseal-static
- cp kubeseal-static kubeseal.exe
after_script: set +e
after_success:
- |
echo OS_NAME=$TRAVIS_OS_NAME BRANCH=$TRAVIS_BRANCH PR=$TRAVIS_PULL_REQUEST GO_VERSION=$TRAVIS_GO_VERSION
if [[ "$TRAVIS_OS_NAME" == linux && \
"$TRAVIS_BRANCH" == master && \
"$TRAVIS_PULL_REQUEST" == false && \
"$TRAVIS_GO_VERSION.0" =~ ^1\.13\. ]]; then
echo "Pushing :latest..."
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" quay.io
docker tag $CONTROLLER_IMAGE ${CONTROLLER_IMAGE_NAME}:latest
docker push ${CONTROLLER_IMAGE_NAME}:latest
fi
before_deploy:
- |
if [ "$TRAVIS_OS_NAME" = linux ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" quay.io
docker push $CONTROLLER_IMAGE
fi
deploy:
api_key:
secure: Q+/wLh9Qbe3dMmmBF1x2Qt5PqdHyHD+wjiRX0fV+leFtNjWEAgcSBrnPxhQVYrvL/tk/In/r9NlvO3VrCv7C11nkYEn5S7RJLIq6+v37Q789hBLchs5dH2FAwNyjA2Sezaf6ulYgqtouuy6Pt0ZY18/rjMcdKl1bYS+TeQU63eRWENgoHI0/yU6fR7w0q0Hjin+a1HCtn0K6YNxc51A0Rc/7TnYgDBSq74cpq+1xsazLrtDXrbtv6+WND5Oe702fwDM/C1b7k8jbmGPstVIWGKA0lfmzaTZUvuNyXbBzz76yBLXrDo41VhS9aBwWoIshTJhVGIl0rr8hy4K0J+MExsmUpp9ZLTwPXd4kFrEWPHFzA6oMNQknO0Lw92O85YpyJ9Jq8c2gPB+/syurhgKjmOHr+x/uGUUlXrYRnuaL/4Wqz5r+UiGcBGGiU9DLn1K8emgChf2FjkA009T/0o0cvUAS3c9WAeqv7P37EJUxpjL3+LrGlaKZaAAo/xAIO100YJ12SAfo0e8TSiMUQ2dngsWxDfWw5Yj90iyx9QE0XswkR5cKU6hsDzRR1xTmtv/jwyMrlgg7/UIQUkvQFZvC7NlkNcEMGCUCIE+Uc41Hh5L6OFqUvb7f/ULQ6D+vJ0wEMteIQolJh7mWSAUUmTiYKYKMR+RikEUtlJg5+TUZ+Y4=
file:
- $EXE_NAME
- kubeseal.exe
- controller.yaml
- controller-norbac.yaml
on:
condition: ${TRAVIS_GO_VERSION}.0 =~ ^1\.13\.
tags: true
provider: releases
skip_cleanup: true
cache:
directories:
- $GOPATH/pkg
- $GOPATH/bin
- $HOME/.minikube/cache
branches:
only:
- master
# release tags
- /^v\d+\.\d+\.\d+.*/
# for bors (in particular: don't build "staging.tmp")
- staging
- trying
notifications:
email:
on_success: never