-
Notifications
You must be signed in to change notification settings - Fork 61
/
.travis.yml
61 lines (56 loc) · 1.94 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
---
dist: xenial
language: python
python:
- "2.7"
- "3.7"
env:
global:
- ANSIBLE_HOST_KEY_CHECKING=False
- PIP_DOWNLOAD_CACHE=$HOME/.cache/pip
- OC_BINARY_URL=https://mirror.openshift.com/pub/openshift-v3/clients/3.10.45/linux/oc.tar.gz
- KUBE_BINARY=https://storage.googleapis.com/kubernetes-release/release/v1.10.13/bin/linux/amd64/kubectl
matrix:
- ANSIBLE_VERSION="latest" APPLIER_CLIENT="oc"
- ANSIBLE_VERSION="2.6" APPLIER_CLIENT="oc"
- ANSIBLE_VERSION="2.7" APPLIER_CLIENT="oc"
- ANSIBLE_VERSION="latest" APPLIER_CLIENT="kubectl"
- ANSIBLE_VERSION="2.6" APPLIER_CLIENT="kubectl"
- ANSIBLE_VERSION="2.7" APPLIER_CLIENT="kubectl"
cache:
directories:
- $HOME/.cache/pip
before_install:
- sudo apt-get update -qq
install:
- pip install -U pip
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible; else pip install ansible~=${ANSIBLE_VERSION}; fi
- pip install "ansible-lint<4.0" yamllint flake8 molecule docker "pytest<3.10" "testinfra==3.0.4"
# Configure OpenShift Binary
- sudo wget -qO- ${OC_BINARY_URL} | sudo tar -xvz -C /bin
- curl -LO ${KUBE_BINARY} && chmod +x ./kubectl && sudo mv ./kubectl /bin/kubectl
before_script:
# Configure Docker
- sudo service docker stop
- sudo mkdir -p /etc/docker
- echo '{"insecure-registries":["172.30.0.0/16"]}' | sudo tee /etc/docker/daemon.json
- sudo service docker start
# Launch OpenShift Environment
- |
set +e
built=false
while true; do
DEV=$(ip link | awk '/state UP/{ gsub(":", ""); print $2}')
IP_ADDR=$(ip addr show $DEV | awk '/inet /{ gsub("/.*", ""); print $2}')
oc cluster up --public-hostname=${IP_ADDR} --routing-suffix=${IP_ADDR}.nip.io --base-dir=/home/travis/ocp
if [ "$?" -eq 0 ]; then
built=true
break
fi
echo "Retrying oc cluster up after failure"
oc cluster down
sleep 5
done
echo "OpenShift Cluster Running"
script:
- molecule test