This repository has been archived by the owner on Aug 14, 2021. It is now read-only.
forked from kubernetes-retired/external-storage
-
Notifications
You must be signed in to change notification settings - Fork 14
/
.travis.yml
110 lines (96 loc) · 3.58 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
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
services:
- docker
language: go
go:
- 1.14.7
addons:
apt:
update: true
jobs:
include:
- os: linux
arch: amd64
env:
- RELEASE_TAG_DOWNSTREAM=1
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- sudo apt-get install --yes -qq gcc
- sudo apt-get install --yes -qq libudev-dev
before_script:
# Download kubectl and setup minkube for running integration tests
# Wait for minikube to be up and ready.
- if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ ;
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.35.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ ;
mkdir -p $HOME/.kube $HOME/.minikube ;
touch $KUBECONFIG ;
sudo minikube start --vm-driver=none --kubernetes-version=v1.13.0 ;
sudo chown -R travis /home/travis/.minikube/ ;
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 ;
fi
script:
- ./openebs-build.sh
# Verify that minkube is setup
# kubectl cluster-info;
# kubectl get deployment;
- if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then
./openebs-ci.sh ;
fi
# 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/external-storage" ]; 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);
./openebs/buildscripts/git-release "$REPO_ORG/openebs-k8s-provisioner" "$TRAVIS_TAG" "$REL_BRANCH" || travis_terminate 1;
fi
after_success:
- git describe --tags --always
- ./openebs-deploy.sh
branches:
only:
- release
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
- /^v\d+\.\d+(\.\S*)?$/