forked from redhat-cop/openshift-applier
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
57 lines (51 loc) · 1.51 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
---
dist: xenial
language: python
python:
- "2.7"
- "3.7"
cache:
directories:
- $HOME/.cache/pip
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
matrix:
- ANSIBLE_VERSION="latest"
- ANSIBLE_VERSION="2.6"
- ANSIBLE_VERSION="2.7"
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"
# Configure OpenShift Binary
- sudo wget -qO- ${OC_BINARY_URL} | sudo tar -xvz -C /bin
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