Skip to content

Commit

Permalink
simply jenkins scripts after ert reorganization
Browse files Browse the repository at this point in the history
  • Loading branch information
akva2 committed Aug 22, 2016
1 parent d58ea13 commit 6a7c3fe
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
23 changes: 4 additions & 19 deletions jenkins/build-opm-parser.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
#!/bin/bash

function build_opm_parser {
# Build ERT
pushd .
mkdir -p $WORKSPACE/deps/ert
cd $WORKSPACE/deps/ert
git init .
git remote add origin https://github.com/Ensembles/ert
git fetch --depth 1 origin $ERT:branch_to_build
test $? -eq 0 || exit 1
git checkout branch_to_build
popd

pushd .
mkdir -p serial/build-ert
cd serial/build-ert
cmake $WORKSPACE/deps/ert/devel -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$WORKSPACE/serial/install
make install
popd

# Build opm-common
pushd .
mkdir -p $WORKSPACE/deps/opm-common
Expand All @@ -29,17 +11,20 @@ function build_opm_parser {
test $? -eq 0 || exit 1
git checkout branch_to_build
popd

source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh

pushd .
mkdir serial/build-opm-common
mkdir -p serial/build-opm-common
cd serial/build-opm-common
build_module "-DCMAKE_INSTALL_PREFIX=$WORKSPACE/serial/install" 0 $WORKSPACE/deps/opm-common
popd

# Setup opm-data
source $WORKSPACE/deps/opm-common/jenkins/setup-opm-data.sh

build_upstreams

# Build opm-parser
pushd .
mkdir serial/build-opm-parser
Expand Down
21 changes: 15 additions & 6 deletions jenkins/build-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,29 @@

source `dirname $0`/build-opm-parser.sh

# Registered upstreams
declare -a upstreams
upstreams=(ert)

# Upstream revisions
ERT_REVISION=master
declare -A upstreamRev
upstreamRev[ert]=master
OPM_COMMON_REVISION=master

if grep -q "ert=" <<< $ghprbCommentBody
then
ERT_REVISION=pull/`echo $ghprbCommentBody | sed -r 's/.*ert=([0-9]+).*/\1/g'`/merge
fi
if grep -q "opm-common=" <<< $ghprbCommentBody
then
OPM_COMMON_REVISION=pull/`echo $ghprbCommentBody | sed -r 's/.*opm-common=([0-9]+).*/\1/g'`/merge
fi

echo "Building with ert=$ERT_REVISION opm-common=$OPM_COMMON_REVISION opm-parser=$sha1"
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

echo "Building with opm-common=$OPM_COMMON_REVISION ert=${upstreamRev[ert]} opm-parser=$sha1"

build_opm_parser
test $? -eq 0 || exit 1
Expand Down
7 changes: 6 additions & 1 deletion jenkins/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

source `dirname $0`/build-opm-parser.sh

ERT_REVISION=master
declare -a upstreams
upstreams=(ert)

declare -A upstreamRev
upstreamRev[ert]=master

OPM_COMMON_REVISION=master

build_opm_parser
Expand Down

0 comments on commit 6a7c3fe

Please sign in to comment.