From ca95ed62da485f869d4107ce0d1120132d8abe93 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 11 Apr 2016 14:16:15 +0200 Subject: [PATCH] add a jenkins script for setting up opm-data there are two modes: - user supplies OPM_DATA_ROOT directly. in this case, the supplied directory is copied into the workspace and used. - user supplies OPM_DATA_ROOT_PREDEFINED. in this case, the supplied path copied into the workspace unless a specific PR is defined in the trigger comment. --- jenkins/setup-opm-data.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 jenkins/setup-opm-data.sh diff --git a/jenkins/setup-opm-data.sh b/jenkins/setup-opm-data.sh new file mode 100755 index 000000000..5755a24ce --- /dev/null +++ b/jenkins/setup-opm-data.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Predefined by environment +if test -z "$OPM_DATA_ROOT" +then + OPM_DATA_REVISION="master" + if grep -q "opm-data=" <<< $ghprbCommentBody + then + OPM_DATA_REVISION=pull/`echo $ghprbCommentBody | sed -r 's/.*opm-data=([0-9]+).*/\1/g'`/merge + fi + # Not specified in trigger, use shared copy + if [[ "$OPM_DATA_REVISION" = "master" ]] && [[ ! "$OPM_DATA_ROOT_PREDEFINED" = "" ]] + then + if ! test -d $WORKSPACE/deps/opm-data + then + cp $OPM_DATA_ROOT_PREDEFINED $WORKSPACE/deps/opm-data -R + fi + else + # Specified in trigger, download it + source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh + clone_module opm-data $OPM_DATA_REVISION + fi +else + if ! test -d $WORKSPACE/deps/opm-data + then + cp $OPM_DATA_ROOT $WORKSPACE/deps/opm-data -R + fi +fi +OPM_DATA_ROOT=$WORKSPACE/deps/opm-data