-
Notifications
You must be signed in to change notification settings - Fork 200
/
.travis.yml
122 lines (107 loc) · 4.08 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
sudo: required
dist: xenial
env:
global:
- CHANGE_MINIKUBE_NONE_USER=true
- MINIKUBE_WANTUPDATENOTIFICATION=false
- MINIKUBE_WANTREPORTERRORPROMPT=false
- MINIKUBE_HOME=$HOME
- CHANGE_MINIKUBE_NONE_USER=true
- KUBECONFIG=$HOME/.kube/config
- RELEASE_TAG=$TRAVIS_TAG
- BRANCH=$TRAVIS_BRANCH
jobs:
include:
- os: linux
arch: amd64
env:
- RELEASE_TAG_DOWNSTREAM=0
services:
- docker
language: go
cache:
directories:
- $HOME/.cache/go-build
go:
- 1.14.7
addons:
apt:
update: true
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- sudo apt-get install --yes -qq gcc jq zip conntrack
- sudo apt-get install --yes -qq libudev-dev
install: true
- make bootstrap
- make format
before_script:
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl
&& chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.8.1/minikube-linux-amd64
&& chmod +x minikube && sudo mv minikube /usr/local/bin/
- mkdir -p $HOME/.kube $HOME/.minikube
- touch $KUBECONFIG
- sudo minikube start --profile=minikube --vm-driver=none --kubernetes-version=v1.18.1
- minikube update-context --profile=minikube
- "sudo chown -R travis: /home/travis/.minikube/"
- eval "$(minikube docker-env --profile=minikube)" && export DOCKER_CLI='docker'
- 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:
- kubectl cluster-info
- 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
- ./buildscripts/travis-build.sh
- ./ci/travis-ci.sh;
# If this build is running due to travis release tag, and
# this job indicates to push the release downstream, then
# go ahead and tag the dependent repo.
#
# $TRAVIS_BRANCH contains the same value as $TRAVIS_TAG.
# Example: TRAVIS_TAG and TRAVIS_BRANCH will have v1.9.0-RC1,
# when github release tag is v1.9.0-RC1
#
# OpenEBS release are triggered from release branches that are named
# as v1.9.x or v1.9.x-hotfix or v1.9.x-custom
#
# The tag to release branch conversion should be handled as follows:
# v1.9.0-RC1 => should be v1.9.x
# v1.9.0-hotfixid => should be v1.9.x-hotfixid
# v1.9.0 => should be v1.9.x
# v1.9.1 => should be v1.9.x
# v1.9.0-custom-RC1 => should be v1.9.x-custom
# v1.9.0-custom => should be v1.9.x-custom
# v1.9.1-custom => should be v1.9.x-custom
# Convert the TRAVIS_TAG to the corresponding release branch.
# Allow for building forked openebs pipelines.
# Tag the downstream repos under current repo org.
- if [ -z $REPO_ORG ]; then
REPO_ORG=$(echo "$TRAVIS_REPO_SLUG" | cut -d'/' -f1);
export REPO_ORG;
fi
- if [ ! -z $TRAVIS_TAG ] && [ $RELEASE_TAG_DOWNSTREAM = 1 ] && [ "$TRAVIS_REPO_SLUG" == "$REPO_ORG/maya" ]; then
TAG_SUFFIX=$(echo "$TRAVIS_TAG" | cut -d'-' -f2);
if [ "$TAG_SUFFIX" == "$TRAVIS_TAG" ] || [[ $TAG_SUFFIX =~ ^RC ]]; then
REL_SUFFIX="";
else
REL_SUFFIX="-$TAG_SUFFIX";
fi;
REL_BRANCH=$(echo $(echo "$TRAVIS_TAG" | cut -d'-' -f1 | rev | cut -d'.' -f2- | rev).x$REL_SUFFIX);
./buildscripts/git-release "$REPO_ORG/velero-plugin" "$TRAVIS_TAG" "${REL_BRANCH}" || travis_terminate 1;
./buildscripts/git-release "$REPO_ORG/cstor-csi" "$TRAVIS_TAG" "${REL_BRANCH}" || travis_terminate 1;
./buildscripts/git-release "$REPO_ORG/upgrade" "$TRAVIS_TAG" "${REL_BRANCH}" || travis_terminate 1;
fi
after_success:
- bash <(curl -s https://codecov.io/bash)
notifications:
email:
recipients:
- kiran.mova@mayadata.io
- shubham.bajpai@mayadata.io
branches:
except:
- /^*-v[0-9]/