Skip to content

Commit

Permalink
added: downstream build support in the jenkins trigger
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
akva2 committed Apr 29, 2016
1 parent 1fbc689 commit 94266d3
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 21 deletions.
8 changes: 2 additions & 6 deletions jenkins/build-opm-core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
57 changes: 44 additions & 13 deletions jenkins/build-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
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

# If no downstream builds we are done
if ! grep -q "with downstreams" <<< $ghprbCommentBody
then
OPM_MATERIAL_REVISION=pull/`echo $ghprbCommentBody | sed -r 's/.*opm-material=([0-9]+).*/\1/g'`/merge
cp serial/build-opm-material/testoutput.xml .
exit 0
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"
source $WORKSPACE/deps/opm-common/jenkins/setup-opm-data.sh
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh

build_opm_core
test $? -eq 0 || exit 1
# Downstream revisions
declare -a downstreams
downstreams=(opm-grid
opm-output
opm-simulators
opm-upscaling
ewoms)

cp serial/build-opm-core/testoutput.xml .
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
11 changes: 9 additions & 2 deletions jenkins/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 94266d3

Please sign in to comment.