-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
60 lines (55 loc) · 3.78 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
sudo: required
cache: pip
# This moves Kubernetes specific config files.
env:
global:
- CHANGE_MINIKUBE_NONE_USER=true
- K8S_VERSION="v1.10.0"
- MINIKUBE_VERSION="v0.28.2"
- HELM_VERSION="v2.10.0-linux-amd64"
- HELM_REPO_VERSION="2.0.1"
before_script:
- sudo mount --make-rshared /
# Download kubectl, which is a requirement for using minikube.
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Download minikube.
- curl -Lo minikube https://github.com/kubernetes/minikube/releases/download/${MINIKUBE_VERSION}/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
# TODO: remove the --bootstrapper flag once this issue is solved: https://github.com/kubernetes/minikube/issues/2704
- sudo minikube config set WantReportErrorPrompt false
- sudo minikube start --vm-driver=none --bootstrapper=localkube --kubernetes-version=${K8S_VERSION} --extra-config=apiserver.Authorization.Mode=RBAC
# Add nsenter binary
- sudo docker run --rm -v /usr/local/bin:/target jpetazzo/nsenter
- minikube update-context
# Fix the kubectl context, as it's often stale.
# - minikube update-context
- curl -Lo helm.tar.gz https://kubernetes-helm.storage.googleapis.com/helm-${HELM_VERSION}.tar.gz
- tar -xf helm.tar.gz
- sudo mv linux-amd64/helm /usr/local/bin/
- rm -rf linux-amd64
- sudo -H pip install planemo
# 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
# Set up helm
- helm init --wait
- helm repo add galaxy-helm-repo https://pcm32.github.io/galaxy-helm-charts
- kubectl create serviceaccount --namespace kube-system tiller
- kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
- kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
script:
- sudo docker build -t test/galaxy-sc-tertiary:v18.05 -f Dockerfile_init .
- kubectl cluster-info
# for kube-dns
- kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
# kube-addon-manager is responsible for managing other kubernetes components, such as kube-dns, dashboard, storage-provisioner..
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n kube-system get pods -lcomponent=kube-addon-manager -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for kube-addon-manager to be available"; kubectl get pods --all-namespaces; done
# Wait for kube-dns to be ready.
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n kube-system get pods -lk8s-app=kube-dns -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for kube-dns to be available"; kubectl get pods --all-namespaces; done
- helm install -f helm-configs/.travis-galaxy-sc-deployment.yaml --name travis --version $HELM_REPO_VERSION galaxy-helm-repo/galaxy-stable
- planemo lint -r --report_level error tools
- kubectl describe pods/$(kubectl get pods | awk '{ print $1 }' | grep -v proftpd | grep -v postgres | grep galaxy)
- ./util/wait-for-deployment -n default -t 600 $(kubectl get deployment | awk '{ print $1 }' | grep 'galaxy-stable$')
# - sleep 360
- kubectl logs $(kubectl get pods | awk '{ print $1 }' | grep -v proftpd | grep -v postgres | grep galaxy)
- kubectl describe pods/$(kubectl get pods | awk '{ print $1 }' | grep -v proftpd | grep -v postgres | grep galaxy)
notifications:
email: false