added: downstream build support in the jenkins trigger

use 'jenkins build this with downstreams please'.

this will build all downstreams against the PR, and
execute their tests. PR's for upstream and downstream modules
can be specified.

the aggregated test results are attached to the job result on jenkins.
This commit is contained in:
Arne Morten Kvarving
2016-04-29 22:52:09 +02:00
parent 1fbc689f6c
commit 94266d37fc
3 changed files with 56 additions and 22 deletions
+2 -6
View File
@@ -38,17 +38,13 @@ function build_opm_core {
build_module "-DCMAKE_INSTALL_PREFIX=$WORKSPACE/serial/install" 0 $WORKSPACE/deps/opm-common
popd
# Build opm-parser
clone_and_build_module opm-parser "-DCMAKE_PREFIX_PATH=$WORKSPACE/serial/install -DCMAKE_INSTALL_PREFIX=$WORKSPACE/serial/install" $OPM_PARSER_REVISION $WORKSPACE/serial
# Build opm-material
clone_and_build_module opm-material "-DCMAKE_PREFIX_PATH=$WORKSPACE/serial/install -DCMAKE_INSTALL_PREFIX=$WORKSPACE/serial/install" $OPM_MATERIAL_REVISION $WORKSPACE/serial
build_upstreams
# Build opm-core
pushd .
mkdir serial/build-opm-core
cd serial/build-opm-core
build_module "-DCMAKE_PREFIX_PATH=$WORKSPACE/serial/install" 1 $WORKSPACE
build_module "-DCMAKE_INSTALL_PREFIX=$WORKSPACE/serial/install -DCMAKE_PREFIX_PATH=$WORKSPACE/serial/install" 1 $WORKSPACE
test $? -eq 0 || exit 1
popd
}
+45 -14
View File
@@ -2,11 +2,17 @@
source `dirname $0`/build-opm-core.sh
# Upstream revisions
declare -a upstreams
upstreams=(opm-parser
opm-material)
declare -A upstreamRev
upstreamRev[opm-parser]=master
upstreamRev[opm-material]=master
ERT_REVISION=master
OPM_COMMON_REVISION=master
OPM_PARSER_REVISION=master
OPM_MATERIAL_REVISION=master
OPM_CORE_REVISION=$sha1
if grep -q "ert=" <<< $ghprbCommentBody
then
@@ -18,19 +24,44 @@ then
OPM_COMMON_REVISION=pull/`echo $ghprbCommentBody | sed -r 's/.*opm-common=([0-9]+).*/\1/g'`/merge
fi
if grep -q "opm-parser=" <<< $ghprbCommentBody
then
OPM_PARSER_REVISION=pull/`echo $ghprbCommentBody | sed -r 's/.*opm-parser=([0-9]+).*/\1/g'`/merge
fi
for upstream in $upstreams
do
if grep -q "$upstream=" <<< $ghprbCommentBody
then
upstreamRev[$upstream]=pull/`echo $ghprbCommentBody | sed -r "s/.*$upstream=([0-9]+).*/\1/g"`/merge
fi
done
if grep -q "opm-material=" <<< $ghprbCommentBody
then
OPM_MATERIAL_REVISION=pull/`echo $ghprbCommentBody | sed -r 's/.*opm-material=([0-9]+).*/\1/g'`/merge
fi
echo "Building with ert=$ERT_REVISION opm-common=$OPM_COMMON_REVISION opm-parser=$OPM_PARSER_REVISION opm-material=$OPM_MATERIAL_REVISION opm-core=$OPM_CORE_REVISION"
echo "Building with ert=$ERT_REVISION opm-common=$OPM_COMMON_REVISION opm-parser=${upstreamRev[opm-parser]} opm-material=${upstreamRev[opm-material]} opm-core=$sha1"
build_opm_core
test $? -eq 0 || exit 1
cp serial/build-opm-core/testoutput.xml .
# If no downstream builds we are done
if ! grep -q "with downstreams" <<< $ghprbCommentBody
then
cp serial/build-opm-material/testoutput.xml .
exit 0
fi
source $WORKSPACE/deps/opm-common/jenkins/setup-opm-data.sh
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
# Downstream revisions
declare -a downstreams
downstreams=(opm-grid
opm-output
opm-simulators
opm-upscaling
ewoms)
declare -A downstreamRev
downstreamRev[opm-grid]=master
downstreamRev[opm-output]=master
downstreamRev[opm-simulators]=master
downstreamRev[opm-upscaling]=master
downstreamRev[ewoms]=master
build_downstreams opm-core
test $? -eq 0 || exit 1
+9 -2
View File
@@ -2,10 +2,17 @@
source `dirname $0`/build-opm-core.sh
# Upstream revisions
declare -a upstreams
upstreams=(opm-parser
opm-material)
declare -A upstreamRev
upstreamRev[opm-parser]=master
upstreamRev[opm-material]=master
ERT_REVISION=master
OPM_COMMON_REVISION=master
OPM_PARSER_REVISION=master
OPM_MATERIAL_REVISION=master
build_opm_core
test $? -eq 0 || exit 1