-
Notifications
You must be signed in to change notification settings - Fork 22
/
.travis.yml
73 lines (72 loc) · 3.47 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
language: java
sudo: required
dist: xenial
env:
global:
- CHANGE_MINIKUBE_NONE_USER=true
- MINIKUBE_WANTUPDATENOTIFICATION=false
- MINIKUBE_WANTREPORTERRORPROMPT=false
- MINIKUBE_HOME=$HOME
- KUBECONFIG=$HOME/.kube/config
jdk:
- openjdk8
scala: 2.12.7
branches:
only:
- master
before_install:
- sudo apt-get -qq -y install conntrack
cache:
directories:
- "$HOME/.m2"
before_script:
# Download kubeval to validate Kubernetes yaml files
- curl -Lo kubeval-linux-amd64.tar.gz https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz && tar xf kubeval-linux-amd64.tar.gz && sudo mv kubeval /usr/local/bin/ && rm -Rf kubeval-linux-amd64.tar.gz
- kubeval k8s/kafka-producer-tpch-order.yaml
- kubeval k8s/metrics-server.yaml
- kubeval k8s/prometheus-*.yaml
- kubeval k8s/grafana-*.yaml
- kubeval k8s/tpch-dbgen-*.yaml
- kubeval k8s/flink-*.yaml
# Download kubectl, which is a requirement for using minikube
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.19.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Download minikube
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.13.1/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
# configure minikube
- mkdir -p $HOME/.kube $HOME/.minikube
- touch $KUBECONFIG
# start minikube
- sudo minikube start --profile=minikube --vm-driver=none --kubernetes-version=v1.19.0
- minikube update-context --profile=minikube
# configure travis-CI with minikube
- "sudo chown -R travis: /home/travis/.minikube/"
- eval "$(minikube docker-env --profile=minikube)" && export DOCKER_CLI='docker'
script:
# checking if kubernetes cluster works
- kubectl cluster-info
# 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
# compiling the Java project at docker/ops-playground-image/java/explore-flink/ with maven
- cd docker/ops-playground-image/java/explore-flink/
- mvn cobertura:cobertura
- mvn package
after_success:
- bash <(curl -s https://codecov.io/bash)
- cd ../../../../
- cd ./operations-playground
- docker-compose build --no-cache
# Log in to the docker CLI. Log in to docker in a single command line
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_ID" --password-stdin
# take the images and push them to docker.hub
- docker push felipeogutierrez/tpch-dbgen
- docker push felipeogutierrez/explore-flink:1.11.2-scala_2.12
- cd ../
# test the explore-flink:1.11.2-scala_2.12 image inside Kubernetes
#- minikube ssh 'sudo ip link set docker0 promisc on'
#- kubectl create -f k8s/tpch-dbgen-pvc.yaml
#- kubectl create -f k8s/tpch-dbgen-datarate-pvc.yaml
#- kubectl create -f k8s/tpch-dbgen-job.yaml
# test if TPCH-dbgen-job is available
#- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n default get jobs -o jsonpath="$JSONPATH" 2>&1 | grep -q "tpch-dbgen-job"; do sleep 1;echo "waiting for tpch-dbgen-job deployment to be available"; kubectl get jobs -n default; done
# delete Kubernetes objects
#- kubectl delete pvc tpch-dbgen-data-pvc tpch-dbgen-datarate-pvc