forked from arquillian/arquillian-cube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
111 lines (101 loc) · 4.61 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
111
sudo: required
matrix:
include:
- env: OC_CLUSTER_UP=true OC_VERSION="v3.7.2" COMMIT_ID="282e43f" CATEGORY="org.arquillian.cube.kubernetes.impl.requirement.RequiresKubernetes"
- env: OC_CLUSTER_UP=true OC_VERSION="v3.7.2" COMMIT_ID="282e43f" CATEGORY="org.arquillian.cube.openshift.impl.requirement.RequiresOpenshift"
- env: OC_CLUSTER_UP=true OC_VERSION="v3.9.0" COMMIT_ID="191fece" CATEGORY="org.arquillian.cube.kubernetes.impl.requirement.RequiresKubernetes"
- env: OC_CLUSTER_UP=true OC_VERSION="v3.9.0" COMMIT_ID="191fece" CATEGORY="org.arquillian.cube.openshift.impl.requirement.RequiresOpenshift"
- env: CATEGORY="org.arquillian.cube.docker.impl.requirement.RequiresDocker"
services:
- docker
addons:
apt:
sources:
- git-core
packages:
- git
language: java
jdk:
- oraclejdk8
cache:
directories:
- $HOME/.m2
before_install:
- BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
- '[ $(git log --format=%B $TRAVIS_COMMIT_RANGE | grep -i "#doc" | wc -l) -gt 0 ] && FORCE_DOC_GEN=0 || FORCE_DOC_GEN=1'
- MODIFIED_DOCS=$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -E 'README.adoc|^docs/.*.adoc$' | wc -l)
- '[ $BRANCH == "master" ] && [ $MODIFIED_DOCS -ge 1 ] && GENERATE_DOC=0 || GENERATE_DOC=1'
- 'if [ $FORCE_DOC_GEN == 0 ] || [ $GENERATE_DOC == 0 ]; then
git config user.name "${GH_USER}";
git config user.email "${GH_EMAIL}";
git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*;
git fetch --unshallow origin gh-pages;
git worktree add -b gh-pages gh-pages origin/gh-pages;
GH_REF=$(git remote get-url origin | awk "{sub(/https:\/\//,\"https://${GH_TOKEN}@\")}; 1" | awk "{sub(/\.git/, \"\")} 1");
docker pull rochdev/alpine-asciidoctor:mini;
fi'
install:
- |
# OpenShift >= 3.7 requires nsenter https://github.com/openshift/origin/issues/17638
if [ ${OC_VERSION} == "v3.7.1" ] || [ ${OC_VERSION} == "v3.7.2" ] ; then
./.travis/nsetter_and_systemd_run_setup.sh
fi
if [ ${OC_CLUSTER_UP} ]; then
tmp=`mktemp`
echo 'DOCKER_OPTS="$DOCKER_OPTS --insecure-registry 172.30.0.0/16"' > ${tmp}
sudo mv ${tmp} /etc/default/docker
sudo mount --make-shared /
sudo service docker restart
docker pull openshift/wildfly-101-centos7
docker pull aslakknutsen/openshift-arquillian-gitserver
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
client_tools="openshift-origin-client-tools-${OC_VERSION}-${COMMIT_ID}-linux-64bit" && curl -LO https://github.com/openshift/origin/releases/download/${OC_VERSION}/${client_tools}.tar.gz && \
tar -xvzf ${client_tools}.tar.gz && sudo mv $PWD/${client_tools}/oc /usr/local/bin/ && rm -rf ${client_tools}.tar.gz
oc cluster up --version=${OC_VERSION} --routing-suffix="127.0.0.1.${OC_DOMAIN:-nip.io}"
sleep 10
oc login -u system:admin
oc get event --all-namespaces
fi
before_script: ./mvnw install -q -U -DskipTests=true
script:
- ./mvnw clean verify -Dfailsafe.groups=${CATEGORY}
- 'if [ $FORCE_DOC_GEN == 0 ] || [ $GENERATE_DOC == 0 ]; then
docker run -v $TRAVIS_BUILD_DIR:/docs/ --name adoc-to-html rochdev/alpine-asciidoctor:mini asciidoctor /docs/README.adoc -a generated-doc=true -a asciidoctor-source=/docs/docs -o /docs/gh-pages/index.html;
fi'
after_success:
- 'if [ $FORCE_DOC_GEN == 0 ] || [ $GENERATE_DOC == 0 ]; then
cd gh-pages;
git add .;
git commit -m"Publishes new documentation";
git push --quiet "${GH_REF}" gh-pages > /dev/null 2>&1;
fi'
- |
if [ ${OC_CLUSTER_UP} ]; then
echo "oc get pods --all-namespaces"
oc get pods --all-namespaces
echo "oc get event --all-namespaces"
oc get event --all-namespaces
fi
after_error:
- 'if [ $FORCE_DOC_GEN == 0 ] || [ $GENERATE_DOC == 0 ]; then
docker logs adoc-to-html;
fi'
- |
if [ ${OC_CLUSTER_UP} ]; then
echo "oc get pods --all-namespaces"
oc get pods --all-namespaces
echo "oc get event --all-namespaces"
oc get event --all-namespaces
fi
after_failure:
- 'if [ $FORCE_DOC_GEN == 0 ] || [ $GENERATE_DOC == 0 ]; then
docker logs adoc-to-html;
fi'
- |
if [ ${OC_CLUSTER_UP} ]; then
echo "oc get pods --all-namespaces"
oc get pods --all-namespaces
echo "oc get event --all-namespaces"
oc get event --all-namespaces
fi