-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
69 lines (61 loc) · 4.06 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
language: ruby
sudo: required
services:
- docker
before_install:
- echo "Installing test gems"
- gem install yaml-lint
- export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
- echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
- curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
- sudo apt-get update
- sudo apt-get install -y dpkg
- sudo apt-get install google-cloud-sdk
- curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.10.5/bin/linux/amd64/kubectl; chmod +x ./kubectl; sudo mv ./kubectl /usr/bin/
- sudo apt-get install jq
- echo $GCP_KEY_FILE | base64 -d > ./keyfile
- gcloud auth activate-service-account -q $(jq -r .client_email keyfile) --key-file=./keyfile --project $(jq -r .project_id keyfile)
- rm ./keyfile
install: true
script:
- yaml-lint -n solace/values-examples/
- yaml-lint -n solace/*.yaml
- echo "Testing GKE deployment, cloud provider Google Cloud Platform (gcp) "
- mkdir gke_test; cd gke_test
- export TESTCLUSTERNAME="sol-gke-travistest-$(date +%s)"
- wget https://raw.githubusercontent.com/SolaceProducts/solace-gke-quickstart/master/scripts/create_cluster.sh
- chmod 755 create_cluster.sh
- ./create_cluster.sh -z us-central1-b,us-central1-c,us-central1-f -c $TESTCLUSTERNAME -m n1-standard-1
- kubectl get statefulset,svc,pods,pvc,pv
- export SOLACE_KUBERNETES_QUICKSTART_REPO="$TRAVIS_REPO_SLUG"; export SOLACE_KUBERNETES_QUICKSTART_BRANCH="$TRAVIS_BRANCH"
- gcloud container clusters get-credentials $TESTCLUSTERNAME --zone us-central1-b --project capable-stream-180018
- wget https://raw.githubusercontent.com/$SOLACE_KUBERNETES_QUICKSTART_REPO/$SOLACE_KUBERNETES_QUICKSTART_BRANCH/scripts/configure.sh
- chmod 755 configure.sh
- #./configure.sh -c gcp -p admin -i gcr.io/capable-stream-180018/solace-pubsub-standard:8.10.0.1057 -v values-examples/prod1k-direct-noha.yaml
- ./configure.sh -c gcp -p admin -i solace/solace-pubsub-standard:8.11.0.1029 -v values-examples/dev100-persist-ha-provisionPvc.yaml
- cd solace-kubernetes-quickstart/solace
- helm install . -f values.yaml
- kubectl get statefulset,svc,pods,pvc,pv --show-labels
- echo "Waiting for cluster to become active"
- "travis_wait 30 sleep 1800 &"
- until kubectl get pods --show-labels | grep solace-0 | grep -m 1 -E 'active=true'; do sleep 10; done
- until kubectl get pods --show-labels | grep solace-1 | grep -m 1 -E '1/1'; do sleep 10; done
- until kubectl get pods --show-labels | grep solace-2 | grep -m 1 -E '1/1'; do sleep 10; done
- kubectl get statefulset,svc,pods,pvc,pv --show-labels
- bash -c 'if [[ `kubectl get po --show-labels | grep -c "1/1"` -ne 3 ]]; then echo "Some pods are not ready!"; kubectl get po --show-labels; exit 1; fi'
- export url="$(kubectl get statefulset,svc,pods,pvc,pv --show-labels | grep LoadBalancer | awk '{print $4}')"; echo $url
- curl -O https://sftp.solace.com/download/SDKPERF_C_LINUX64
- tar -xvf SDKPERF_C_LINUX64
- pubSubTools/sdkperf_c -cip=$url -mn=100000 -mr=0 -ptl=t1 -stl=t1 | grep "Total Messages"
- sleep 30
- bash -c 'if [[ -z `curl -sS -u admin:admin http://$url:8080/SEMP -d "<rpc semp-version=\"soltr/8_5VMR\"><show><config-sync></config-sync></show></rpc>" | grep "<oper-status>Up</oper-status>"` ]] ; then echo "config-sync not up!"; exit 1; fi'
- curl -sS -u admin:admin http://$url:8080/SEMP -d "<rpc semp-version=\"soltr/8_5VMR\"><show><redundancy></redundancy></show></rpc>"
- curl -sS -u admin:admin http://$url:8080/SEMP -d "<rpc semp-version=\"soltr/8_5VMR\"><show><config-sync></config-sync></show></rpc>"
after_success:
- echo "Test Success - Branch($TRAVIS_BRANCH) Pull Request($TRAVIS_PULL_REQUEST) Tag($TRAVIS_TAG)"
- echo "YAML linted"
- echo "GKE cluster deployment tested"
- echo "Messaging tested"
after_script:
- gcloud container clusters delete $TESTCLUSTERNAME --quiet --zone us-central1-b
- gcloud compute disks list | grep travis | sed 1d $rpt | while read -r a b c; do gcloud compute disks delete $a --zone $b --quiet; done