Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Fixes #1198 : Fix CI setup of fabric8 maven plugin
Browse files Browse the repository at this point in the history
Add nsenter dependency
  • Loading branch information
rohanKanojia committed Mar 27, 2018
1 parent b11749d commit 2f5910a
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 354 deletions.
282 changes: 0 additions & 282 deletions .circleci/config.yml

This file was deleted.

29 changes: 27 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
# We use Travis for the following tasks:
# - Download and install `kubectl`, `oc` CLI client tools
# - Configure docker daemon to run insecure registry for OpenShift cluster
# - Execute `oc cluster up` with different environments (metrics profile) : v3.6.0, v3.6.1, v3.7.0
# - Updating the Sonarqube stats when not on a PR
# - Update Codecov (codecov.io) stats for every build
# - Regenerate the docs when commit on master (but not for a PR)

matrix:
include:
- env: OC_VERSION="v3.6.1" COMMIT_ID="008f2d5"
- env: OC_VERSION="v3.7.2" COMMIT_ID="282e43f"

sudo: required
dist: trusty
group: deprecated-2017Q4

language: java
jdk:
- oraclejdk8

services:
- docker

cache:
directories:
- $HOME/.m2

install: ./rt/src/main/resources/scripts/prepare-test-environment.sh

before_script: mvn clean install -DskipTests

script:
# Profile jacoco switches on jacoco coverages
- mvn test -B -Pjacoco
# Profile jacoco switches on jacoco coverages, regession-test for running regreesion tests on fabric8/OpenShift.io quickstart projects
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B install -pl rt -P regression-test
# Only build docs when commited on master and not a pull request.
# See https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
# for more details about Travis default vars
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## fabric8-maven-plugin

[![Travis](https://secure.travis-ci.org/fabric8io/fabric8-maven-plugin.png)](http://travis-ci.org/fabric8io/fabric8-maven-plugin)
[![Circle CI](https://circleci.com/gh/fabric8io/fabric8-maven-plugin/tree/master.svg?style=shield)](https://circleci.com/gh/fabric8io/fabric8-maven-plugin/tree/master)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=io.fabric8%3Afabric8-maven-plugin-build&metric=coverage)](https://sonarcloud.io/dashboard?id=io.fabric8%3Afabric8-maven-plugin-build)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=io.fabric8%3Afabric8-maven-plugin-build&metric=sqale_index)](https://sonarcloud.io/dashboard?id=io.fabric8%3Afabric8-maven-plugin-build)
[![Dependency Status](https://dependencyci.com/github/fabric8io/fabric8-maven-plugin/badge)](https://dependencyci.com/github/fabric8io/fabric8-maven-plugin)
Expand Down
60 changes: 60 additions & 0 deletions rt/src/main/resources/scripts/prepare-test-environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/sh

#install kubernetes and openshift CLI tools
kube_version=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
curl -LO https://storage.googleapis.com/kubernetes-release/release/${kube_version}/bin/linux/amd64/kubectl && \
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
echo "Installed kubectl CLI tool"


echo "Installing nsenter"
if ! which nsenter > /dev/null; then
echo "Did not find nsenter. Installing it."
NSENTER_BUILD_DIR=$(mktemp -d /tmp/nsenter-build-XXXXXX)
pushd ${NSENTER_BUILD_DIR}
curl https://www.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-2.31.tar.gz | tar -zxf-
cd util-linux-2.31
./configure --without-ncurses
make nsenter
sudo cp nsenter /usr/local/bin
rm -rf "${NSENTER_BUILD_DIR}"
popd
fi
if ! which systemd-run > /dev/null; then
echo "Did not find systemd-run. Hacking it to work around Kubernetes calling it."
echo '#!/bin/bash
echo "all arguments: "$@
while [[ $# -gt 0 ]]
do
key="$1"
if [[ "${key}" != "--" ]]; then
shift
continue
fi
shift
break
done
echo "remaining args: "$@
exec $@' | sudo tee /usr/bin/systemd-run >/dev/null
sudo chmod +x /usr/bin/systemd-run
fi

oc_tool_version="openshift-origin-client-tools-${OC_VERSION}-${COMMIT_ID}-linux-64bit"
curl -LO https://github.com/openshift/origin/releases/download/${OC_VERSION}/${oc_tool_version}.tar.gz && \
tar -xvzf ${oc_tool_version}.tar.gz && chmod +x $PWD/${oc_tool_version}/oc && sudo mv $PWD/${oc_tool_version}/oc /usr/local/bin/ && \
rm -rf ${oc_tool_version}.tar.gz
echo "Installed OC CLI tool"

#add insecure docker registry
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
echo "Configured Docker daemon with insecure-registry"

#make OpenShift up & running
oc cluster up --version=${OC_VERSION}
sleep 10
oc login -u developer -p developer
echo "Configured OpenShift cluster : ${OC_VERSION}"
Loading

0 comments on commit 2f5910a

Please sign in to comment.