forked from operator-framework/operator-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
49 lines (41 loc) · 1.85 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
language: go
go_import_path: github.com/operator-framework/operator-sdk
sudo: required
services:
- docker
go:
- 1.10.1
env:
- CHANGE_MINIKUBE_NONE_USER=true
before_script:
- curl -Lo dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 && chmod +x dep && sudo mv dep /usr/local/bin/
- dep ensure
# Download kubectl, which is a requirement for using minikube.
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.1/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Download minikube.
# We need to pin to an old version due to minikube requiring systemd starting with v0.26.0 and travis not providing it
# - https://github.com/kubernetes/minikube/issues/2704
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.2/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
- sudo minikube start --vm-driver=none --kubernetes-version=v1.10.0
# Fix the kubectl context, as it's often stale.
- minikube update-context
# Wait for Kubernetes to be up and ready.
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
# Create example operator directory
- mkdir -p $GOPATH/src/github.com/example-inc
install:
- go get -t -d ./...
script:
- make install
- go test ./pkg/...
- go test ./test/e2e/...
- go vet ./...
- ./hack/check_license.sh
- ./hack/check_error_case.sh
after_success:
- echo 'Build succeeded, operator was generated, memcached operator is running on minikube, and unit/integration tests pass'
after_failure:
- echo 'Build failed, operator failed to generate, memcached operator is not running on minikube, or unit/integration tests failed'
- kubectl get deployment
- kubectl get pods
- kubectl describe pods