forked from AmadeusITGroup/kubervisor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
76 lines (76 loc) · 2.9 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
language: go
dist: trusty
sudo: required
go:
- 1.9.x
os: linux
services:
- docker
env:
global:
- CHANGE_MINIKUBE_NONE_USER=true
- TAG=${TRAVIS_TAG:=${TRAVIS_COMMIT}}
- GH_URL=https://amadeusitgroup.github.io/kubervisor
- IMAGE_NAME=traviscontroller
go_import_path: github.com/amadeusitgroup/kubervisor
before_install:
# install nsenter for helm and port forwarding
- sudo apt-get -qq update
- sudo apt-get install -y socat
- docker run --rm jpetazzo/nsenter cat /nsenter > /tmp/nsenter && chmod +x /tmp/nsenter
- sudo cp /tmp/nsenter /usr/local/bin
install:
# Download kubectl, which is a requirement for using minikube.
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.9.4/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Download minikube.
- 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.9.4 --extra-config=apiserver.Authorization.Mode=RBAC
# 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
# Add missing permission for dashboard when RBAC is activated
- kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
- kubectl get nodes
- kubectl get pods --all-namespaces
- curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
- kubectl -n kube-system create sa tiller
- kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
- helm init --service-account tiller
- go get -u github.com/alecthomas/gometalinter && gometalinter --install
stages:
- name: build
- name: release
if: tag IS present
jobs:
include:
- stage: build
name: build
script:
- make build
- make test
- make lint
- make TAG=latest container
- cd test/e2e && make TAG=latest container && cd -
- helm install --wait --version latest -n end2end-test charts/kubervisor
- cd ./test/e2e && go test -c && ./e2e.test --kubeconfig=$HOME/.kube/config --ginkgo.slowSpecThreshold 200
- helm delete end2end-test
- stage: release
script:
- docker login -u "$DOCKER_USERNAME" p "$DOCKER_PASSWORD"
- curl -sL https://git.io/goreleaser | bash
deploy:
- provider: releases
api_key:
secure: $GITHUB_TOKEN
skip_cleanup: true
file:
- docs/helm-kubervisor-$TAG.tgz
on:
tags: true
branches:
only:
- master
- /^v\d+(\.\d+)+$/
after_success:
- bash <(curl -s https://codecov.io/bash) -f $TRAVIS_BUILD_DIR/coverage.txt