summaryrefslogtreecommitdiffstats
path: root/jjb/apex
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-03-28 13:10:19 -0700
committerTim Rozet <trozet@redhat.com>2018-03-28 13:10:19 -0700
commitbb078033273acb4b1b71fd016fbbddc1c8feb1a4 (patch)
treeea7a18ab9b5c0aff3353b58093fc75717d1e3beb /jjb/apex
parent058009d0462e11754888b7ae51b9c08fa8f0487f (diff)
Apex: Adds parsing scenario on artifact download
Download was not properly being skipped on upstream scenarios because the scenario was not being detected and was set as "gate". Change-Id: I38533ad8140be48726aa2cb1c106d7ef6ca9afd5 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'jjb/apex')
-rwxr-xr-xjjb/apex/apex-download-artifact.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/jjb/apex/apex-download-artifact.sh b/jjb/apex/apex-download-artifact.sh
index c12406cdb..066d61203 100755
--- a/jjb/apex/apex-download-artifact.sh
+++ b/jjb/apex/apex-download-artifact.sh
@@ -10,6 +10,26 @@ echo
[[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
+if [ -z "$DEPLOY_SCENARIO" ]; then
+ echo "Deploy scenario not set!"
+ exit 1
+elif [[ "$DEPLOY_SCENARIO" == *gate* ]]; then
+ echo "Detecting Gating scenario..."
+ if [ -z "$GERRIT_EVENT_COMMENT_TEXT" ]; then
+ echo "ERROR: Gate job triggered without comment!"
+ exit 1
+ else
+ DEPLOY_SCENARIO=$(echo ${GERRIT_EVENT_COMMENT_TEXT} | grep start-gate-scenario | grep -Eo 'os-.*$')
+ if [ -z "$DEPLOY_SCENARIO" ]; then
+ echo "ERROR: Unable to detect scenario in Gerrit Comment!"
+ echo "Format of comment to trigger gate should be 'start-gate-scenario: <scenario>'"
+ exit 1
+ else
+ echo "Gate scenario detected: ${DEPLOY_SCENARIO}"
+ fi
+ fi
+fi
+
# if upstream we do not need to download anything
if [[ "$DEPLOY_SCENARIO" =~ upstream ]]; then
echo "Upstream deployment detected, skipping download artifact"