Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ pipeline {
}

stage("${OS} Test") {
EVENT_PORT = OSList.indexOf(OS) + 4100
sh "./deploy/build.sh --os=${OS} --test --eventport=${EVENT_PORT}"
network="jenkins-${EXECUTOR_NUMBER}-${OS}"
sh "./deploy/build.sh --os=${OS} --test --dockernetwork=${network}"
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions deploy/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ OPTIONS
before performing the build. If a docker image is not already
present on the system it will automatically pulled from dockerhub
even without the --dockerpull option.

--dockernetwork
If specified, a docker network with this name will be created,
used for the docker container, and then removed.

--keys=dir
Specifies a directory containing signing keys and certificates
Expand Down Expand Up @@ -356,6 +360,9 @@ parsecmd() {
--dockerfile=*)
eval "DOCKERFILE=${i#*=}"
;;
--dockernetwork=*)
eval "DOCKERNETWORK=${i#*=}"
;;
--keys=*)
eval "KEYS=${i#*=}"
;;
Expand Down Expand Up @@ -644,6 +651,7 @@ OS=${OS} \
PUBLISHDIR=${PUBLISHDIR} \
DOCKERIMAGE=${DOCKERIMAGE} \
DOCKERFILE=${DOCKERFILE} \
DOCKERNETWORK=${DOCKERNETWORK} \
KEYS=${KEYS} \
DISTNAME=${DISTNAME} \
UPDATEPKG=${UPDATEPKG} \
Expand Down
16 changes: 12 additions & 4 deletions deploy/platform/platform_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ rundocker() {
docker rm $(cat ${WORKSPACE}/${OS}_docker-cid) || true
rm -f ${WORKSPACE}/${OS}_docker-cid
fi
if [ ! -z $DOCKERNETWORK ]; then
docker network rm ${DOCKERNETWORK} || true
fi
}

function abort() {
Expand All @@ -99,9 +102,13 @@ rundocker() {
while [ $status = 127 -a $loop_count -lt 5 ]; do
let loop_count=$loop_count+1

kill_docker
network=""
if [ ! -z $DOCKERNETWORK ]; then
docker network create ${DOCKERNETWORK}
network="--network=${DOCKERNETWORK}"
fi

docker run --cap-add=SYS_PTRACE -t $stdio \
docker run --cap-add=SYS_PTRACE -t $stdio $network \
--cidfile=${WORKSPACE}/${OS}_docker-cid \
-u $(id -u):$(id -g) --privileged -h $DISTNAME -e "srcdir=${DOCKER_SRCDIR}" \
-e "ARCH=${arch}" \
Expand Down Expand Up @@ -145,9 +152,10 @@ rundocker() {
docker logs --follow $cid

status=$(docker inspect $cid --format='{{.State.ExitCode}}')

docker rm $cid
fi

kill_docker

done
if [ ! "$status" = "0" ]; then
RED
Expand Down