-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial setup for openshift integration tests
- Loading branch information
1 parent
bf9609f
commit 02bbdc7
Showing
3 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
openshift.local.clusterup* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |