forked from KohlsTechnology/eunomia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
62 lines (57 loc) · 2.72 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
branches:
only:
- master
- /^v\d+\.\d+\.\d+$/
sudo: required
language: go
go_import_path: github.com/KohlsTechnology/eunomia
go:
- "1.12.x"
env:
global:
- GO111MODULE=on
- CHANGE_MINIKUBE_NONE_USER=true
matrix:
- OPERATOR_SDK_VERSION=v0.8.1 KUBE_VERSION=v1.14.2 MINIKUBE_VERSION=v1.3.1
before_install:
- travis_retry go mod vendor
- go get golang.org/x/lint/golint
# Next four lines of code create deploy key for travis to be able to push to the gh-pages branch.
# See https://gist.github.com/qoomon/c57b0dc866221d91704ffef25d41adcf and
# https://medium.com/@simon.legner/deploy-to-github-pages-using-travis-ci-and-deploy-keys-db84fed7a929 on how to do it.
# Lines use encrypted_18f270609d30_key and encrypted_18f270609d30_iv variables set in Travis settings to decrypt
# github_deploy_key.enc file into github_deploy_key and then add this key to ssh-agent session. All of this happens only
# if current build is on repository tag.
- if [[ "$TRAVIS_TAG" ]]; then openssl aes-256-cbc -K $encrypted_18f270609d30_key -iv $encrypted_18f270609d30_iv -in github_deploy_key.enc -out github_deploy_key -d; fi
- if [[ "$TRAVIS_TAG" ]]; then chmod 600 github_deploy_key; fi
- if [[ "$TRAVIS_TAG" ]]; then eval $(ssh-agent -s); fi
- if [[ "$TRAVIS_TAG" ]]; then ssh-add github_deploy_key; fi
before_script:
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/bin/linux/amd64/kubectl
- sudo chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-amd64
- sudo chmod +x minikube && sudo mv minikube /usr/local/bin/
- curl -LO https://git.io/get_helm.sh && chmod 700 get_helm.sh && ./get_helm.sh
- curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${OPERATOR_SDK_VERSION}/operator-sdk-${OPERATOR_SDK_VERSION}-x86_64-linux-gnu
- chmod +x operator-sdk-${OPERATOR_SDK_VERSION}-x86_64-linux-gnu
- sudo mkdir -p /usr/local/bin/
- sudo cp operator-sdk-${OPERATOR_SDK_VERSION}-x86_64-linux-gnu /usr/local/bin/operator-sdk
- rm operator-sdk-${OPERATOR_SDK_VERSION}-x86_64-linux-gnu
- sudo minikube start --vm-driver=none --kubernetes-version=${KUBE_VERSION}
- minikube update-context
- 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
script:
- make test
deploy:
- provider: script
skip_cleanup: true
script: make travis-deploy-images
on:
repo: KohlsTechnology/eunomia
branch: master
- provider: script
skip_cleanup: true
script: make travis-release
on:
repo: KohlsTechnology/eunomia
tags: true