This is an automated email from the ASF dual-hosted git repository. nferraro pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 02bbdc7bff100fafe6876b82f9b4979b61825ebb Author: nferraro <ni.ferr...@gmail.com> AuthorDate: Mon Oct 8 15:44:36 2018 +0200 Initial setup for openshift integration tests --- .dockerignore | 1 + .travis.yml | 14 ++++++++ build/prepare_integration_tests_travis.sh | 57 +++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6b9e372 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +openshift.local.clusterup* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 28b3a4b..13d1d39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,19 @@ +sudo: required + language: go go: - "1.10.x" +env: + global: + - OPENSHIFT_VERSION=3.10.0 + - OPENSHIFT_COMMIT=dd10d17 + +services: + - docker + +script: + - make + - ./build/prepare_integration_tests_travis.sh + - make test-integration diff --git a/build/prepare_integration_tests_travis.sh b/build/prepare_integration_tests_travis.sh new file mode 100755 index 0000000..8fc3102 --- /dev/null +++ b/build/prepare_integration_tests_travis.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +set -e + +# set docker0 to promiscuous mode +sudo ip link set docker0 promisc on + +# Download and install the oc binary +sudo mount --make-shared / +sudo service docker stop +sudo sed -i 's/DOCKER_OPTS=\"/DOCKER_OPTS=\"--insecure-registry 172.30.0.0\/16 /' /etc/default/docker +sudo service docker start +wget https://github.com/openshift/origin/releases/download/v$OPENSHIFT_VERSION/openshift-origin-client-tools-v$OPENSHIFT_VERSION-$OPENSHIFT_COMMIT-linux-64bit.tar.gz +tar xvzOf openshift-origin-client-tools-v$OPENSHIFT_VERSION-$OPENSHIFT_COMMIT-linux-64bit.tar.gz > oc.bin +sudo mv oc.bin /usr/local/bin/oc +sudo chmod 755 /usr/local/bin/oc + +# Figure out this host's IP address +IP_ADDR="$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)" + +# Start OpenShift +oc cluster up --public-hostname=$IP_ADDR + +oc login -u system:admin + +# Wait until we have a ready node in openshift +TIMEOUT=0 +TIMEOUT_COUNT=60 +until [ $TIMEOUT -eq $TIMEOUT_COUNT ]; do + if [ -n "$(oc get nodes | grep Ready)" ]; then + break + fi + + echo "openshift is not up yet" + let TIMEOUT=TIMEOUT+1 + sleep 5 +done + +if [ $TIMEOUT -eq $TIMEOUT_COUNT ]; then + echo "Failed to start openshift" + exit 1 +fi + +echo "openshift is deployed and reachable" +oc describe nodes + +echo "Adding maven artifacts to the image context" +./build/package_maven_artifacts.sh + +echo "Building the images" +export IMAGE=docker.io/apache/camel-k:$(./build/get_version.sh) +./tmp/build/docker_build.sh + +echo "installing camel k cluster resources" +./kamel install --cluster-setup + +oc login -u developer