-
Notifications
You must be signed in to change notification settings - Fork 43
/
.travis.yml
48 lines (42 loc) · 2.27 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
sudo: required
dist: trusty
env:
global:
- OCP_VERSION=v3.6.1
- TARGET=centos7
matrix:
- VARIANT=starter
- VARIANT=starter-arbitrary-uid
- VARIANT=starter-epel
- VARIANT=starter-systemd
- VARIANT=starter-nsswrapper
- VARIANT=starter-api
- VARIANT=starter-scratch
services:
- docker
before_install:
- export BUILD=`git diff --name-only HEAD~1 | awk -F '/' '{print $1}' | uniq | grep -w ^${VARIANT}$`
install:
- if [ ${BUILD} ]; then sudo apt-get -qq update; fi
- if [ ${BUILD} ]; then sudo apt-get install -y nodejs jq; fi
- if [ ${BUILD} ]; then npm install -g dockerfile_lint; fi
- if [ ${BUILD} ]; then make lint -C ${VARIANT}; fi
before_script:
- if [ ${BUILD} ]; then export PATH=$PATH:$HOME/bin; fi
- if [ ${BUILD} ]; then tmp=`mktemp`; fi
- if [ ${BUILD} ]; then echo '{"insecure-registries":["172.30.0.0/16"]}' > ${tmp}; fi
- if [ ${BUILD} ]; then sudo mv ${tmp} /etc/docker/daemon.json; fi
- if [ ${BUILD} ]; then sudo mount --make-shared /; fi
- if [ ${BUILD} ]; then sudo service docker restart; fi
script:
- if [ ${BUILD} ]; then make -C ${VARIANT} TARGET=${TARGET}; fi
- if [ ${BUILD} ]; then make test -C ${VARIANT} TARGET=${TARGET}; fi
- if [ ${BUILD} ]; then wget `curl -s https://api.github.com/repos/openshift/origin/releases/latest | jq -r ".assets[] | select(.name | test(\"linux-64bit\")) | .browser_download_url" | grep -i client-tools`; fi
- if [ ${BUILD} ]; then tar xvfz `ls openshift-origin-client-tools-*.tar.gz` --strip-components=1 -C $HOME/bin; fi
- if [ ${BUILD} ]; then if [ ${OCP_VERSION} ]; then oc cluster up --version=${OCP_VERSION}; else oc cluster up; fi; fi
- if [ ${BUILD} ]; then export OC_USER=`oc whoami` OC_PASS=`oc whoami -t`; fi
- if [ ${BUILD} ]; then oc login -u system:admin; fi
- if [ ${BUILD} ]; then oc rollout status -w dc/docker-registry -n default || oc rollout retry dc/docker-registry -n default && oc rollout status -w dc/docker-registry -n default; fi
- if [ ${BUILD} ]; then export REGISTRY=`oc get svc/docker-registry -n default --template '{{.spec.clusterIP}}:{{index .spec.ports 0 "port"}}'`; fi
- if [ ${BUILD} ]; then make openshift-test -C ${VARIANT} TARGET=${TARGET} REGISTRY=${REGISTRY} OC_USER=${OC_USER} OC_PASS=${OC_PASS}; fi
- if [ ${BUILD} ]; then oc version; fi