forked from bitnami-labs/sealed-secrets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
155 lines (136 loc) · 4.95 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
language: go
go:
- '1.9'
- '1.8'
services:
- docker
os:
- linux
- osx
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.9.0 INT_SSC_CONF=sealedsecret-crd.yaml,controller.yaml
- env: INT_KVERS=v1.8.0 INT_SSC_CONF=sealedsecret-crd.yaml,controller.yaml
- env: INT_KVERS=v1.7.0 INT_SSC_CONF=sealedsecret-crd.yaml,controller.yaml
- env: INT_KVERS=v1.7.0 INT_SSC_CONF=sealedsecret-tpr.yaml,controller.yaml
- env: INT_KVERS=v1.6.0 INT_SSC_CONF=sealedsecret-tpr.yaml,controller.yaml
addons:
apt:
packages:
- wget
- ca-certificates
before_install:
- set -e
install:
- go build -i ./...
- |
if [ "$INT_KVERS" != "" ]; then
v=0.25.0
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)
touch $KUBECONFIG
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
- |
v=0.8.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
- git clone --depth=1 https://github.com/ksonnet/ksonnet-lib.git
- export KUBECFG_JPATH=$PWD/ksonnet-lib
script:
- make
- make test
- if [[ ${TRAVIS_GO_VERSION}.0 =~ ^1\.9\. ]]; then make vet; fi
- 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 sealedsecret-crd.yaml sealedsecret-tpr.yaml CONTROLLER_IMAGE=$CONTROLLER_IMAGE
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
fi
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\.9\. ]]; 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: Bp7TwgtJVDnYSwXAP7uRHN1uXGILOvOASNDGHJI69GB+lG0RU6zqdOQJw8kKWjA67cKSW8RIuQuVlRsuNce3xa9sh1pB4OVZEJGoOiZrLVCM9s+iACuGjuKJB/GYLDDHhZYUTHp6o2Fymud9XhgqU/zpo/vAeVOTlGpj09dwZ0ZHAhivrx9Ubruo5uBgOe/nIcSDnQ9u5if0TOK4rg3EtxFf1ihiu6UXxZKjdi0Hqow8sQOjtqg82iAgpWwYRSIL4ePWear2FpnNMfIvRIMe7DNZvZ6uE9t/wkbLPOlTKSmkYw2YqOw4BvnDa7s8XcsOEzJHvyLh8sSrRFNR2VEiGuGDUPKJEpTJ+88ay7aeN0OLopAxMY0eTECWEKpFIJj6T48PoudevnT+HEBkvy4EkM4zEaf1HATMkZHUIL9qLY//hdMA2/usptLfZMqA2Ouj80Tpzr0AQ1u0QF7CYZt5Ga3YBoCt7yXfhKJ3w5i5EcObTcZBKXi5ScGdri3KfkB1CUuGrp1e/QDo1VWkLhoIGCJvCZnZGH7qDCH8gGyxWvIWTEro+yhmUg+I8786lqDzWLFKCA3NGf0b1W7nvI4pmsGRG5dIrWmpSUfaIJRDqi5R8Nj5S+VV3sdq/bT8+4n4yHcZnDQKdoCjO6K/WBTYBiq8igCIJ3obaWeH8i/XHLg=
file:
- $EXE_NAME
- controller.yaml
- controller-norbac.yaml
- sealedsecret-tpr.yaml
- sealedsecret-crd.yaml
on:
condition: ${TRAVIS_GO_VERSION}.0 =~ ^1\.9\.
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