From: Mike Marchetti Date: Thu, 25 May 2017 14:48:11 +0000 (-0400) Subject: utilize docker for building osmclient X-Git-Tag: v2.0.1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=f8976a15da8fb61852067ab6b4cffbb3bd8cde0b;p=osm%2Fdevops.git utilize docker for building osmclient Change-Id: I0054fee8c29a71ffaf514276c90e5f00b3466854 Signed-off-by: Mike Marchetti --- diff --git a/jenkins/host/start_build b/jenkins/host/start_build index 45d495f2..a78d3944 100755 --- a/jenkins/host/start_build +++ b/jenkins/host/start_build @@ -34,6 +34,7 @@ if ! container_exists $OSM_BUILD_CONTAINER; then CONTAINER_OPTS="" [[ "$OSM_BUILD_CONTAINER_PRIVILEGED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.privileged=true" [[ "$OSM_BUILD_CONTAINER_ALLOW_NESTED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.nesting=true" + [[ "$OSM_BUILD_CONTAINER_ALLOW_DOCKER" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -p docker -p default" create_container $OSM_BASE_IMAGE $OSM_BUILD_CONTAINER $CONTAINER_OPTS wait_container_up $OSM_BUILD_CONTAINER RE="fedora|fc[0-9]" diff --git a/jenkins/osmclient/SETTINGS b/jenkins/osmclient/SETTINGS index 123af25d..36e50151 100644 --- a/jenkins/osmclient/SETTINGS +++ b/jenkins/osmclient/SETTINGS @@ -24,3 +24,5 @@ export OSM_BUILD_CONTAINER=osmclient # this variable holds the name of the container to be used to run a package # if this container already exists, the run processes can skip the container build export OSM_RUNTIME_CONTAINER=osmclient + +export OSM_BUILD_CONTAINER_ALLOW_DOCKER=yes diff --git a/jenkins/osmclient/start_build b/jenkins/osmclient/start_build index 2aaeadc9..df4fc27a 100755 --- a/jenkins/osmclient/start_build +++ b/jenkins/osmclient/start_build @@ -34,11 +34,17 @@ fi OSM_git_checkout "$@" -apt-get update -apt-get install -y make -make build_tools -make test -make package +apt update +apt install -y docker.io + +docker build -t $OSM_MDG . +DOCKER_ARGS="-v $(pwd):$(pwd) -w $(pwd) -u $(id -u):$(id -g) $OSM_MDG" + +if [ -n "$NOTEST" ]; then + docker run $DOCKER_ARGS /bin/bash -c "./docker_command.sh $(id -u -n) $(id -g -n) tox" +fi + +docker run $DOCKER_ARGS /bin/bash -c "./docker_command.sh $(id -u -n) $(id -g -n) tox -e build" RC=$? INFO "done, RC=$RC"