This repository has been archived by the owner on Apr 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
72 lines (70 loc) · 2.66 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
sudo: required
dist: trusty
language: go
## home folder is /home/travis/gopath/src/github.com/radanalyticsio/oshinko-cli
services:
- docker
matrix:
include:
- env: TO_TEST=e2e
fast_finish: true
before_install:
## add insecure-registry and restart docker
- pwd
- bash --version
- sudo apt-get install --only-upgrade bash
- bash --version
- sudo cat /etc/default/docker
- sudo service docker stop
- sudo sed -i -e 's/sock/sock --insecure-registry 172.30.0.0\/16/' /etc/default/docker
- sudo cat /etc/default/docker
- sudo service docker start
- sudo service docker status
## chmod needs sudo, so all other commands are with sudo
- sudo mkdir -p /home/travis/gopath/src/github.com/radanalyticsio/origin
- sudo chmod -R 766 /home/travis/gopath/src/github.com/radanalyticsio/origin
## download oc binary
- sudo wget https://github.com/openshift/origin/releases/download/v3.7.0/openshift-origin-client-tools-v3.7.0-7ed6862-linux-64bit.tar.gz -O ../origin/openshift-origin-client-tools.tar.gz
- sudo wget https://github.com/openshift/origin/releases/download/v3.7.0/openshift-origin-server-v3.7.0-7ed6862-linux-64bit.tar.gz -O ../origin/openshift-origin-server.tar.gz
- sudo ls -l /home/travis/gopath/src/github.com/radanalyticsio/origin
- sudo tar -xvzf //home/travis/gopath/src/github.com/radanalyticsio/origin/openshift-origin-client-tools.tar.gz --strip-components=1 -C /bin
- sudo tar -xvzf /home/travis/gopath/src/github.com/radanalyticsio/origin/openshift-origin-client-tools.tar.gz --strip-components=1 -C /bin
- sudo ls -l /bin
- oc version
- export PATH=$PATH:/home/travis/gopath/src/github.com/radanalyticsio/origin
- echo $PATH
# below cmd is important to get oc working in ubuntu
- sudo docker run -v /:/rootfs -ti --rm --entrypoint=/bin/bash --privileged openshift/origin:v3.7.0 -c "mv /rootfs/bin/findmnt /rootfs/bin/findmnt.backup"
- sudo chmod 777 ./travis-check-pods.sh
- |
# Sometimes oc cluster up fails with a permission error and works when the test is relaunched.
# See if a retry within the same test works
set +e
built=false
while true; do
oc cluster up --host-config-dir=/home/travis/gopath/src/github.com/radanalyticsio/origin
if [ "$?" -eq 0 ]; then
./travis-check-pods.sh
if [ "$?" -eq 0 ]; then
built=true
break
fi
fi
echo "Retrying oc cluster up after failure"
oc cluster down
sleep 5
done
set -e
if [ "$built" == false ]; then
exit 1
fi
# travis-check-pods.sh left us in the default project
oc project myproject
install:
before_script:
script:
- if [ "$TO_TEST" = "e2e" ]; then make test-e2e ; fi
notifications:
email:
on_success: never
on_failure: never