summaryrefslogtreecommitdiffstats
path: root/jjb/apex/apex-functest-scenario.sh
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2018-10-30 12:32:33 -0700
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2018-10-30 12:32:33 -0700
commit532d544beffedc438c6cc7f2f59d1880d05c779d (patch)
tree2303091f25764c6e60a7db3b5b10d784fec824f2 /jjb/apex/apex-functest-scenario.sh
parentf815ee40627b33c71a22a8df29789d7d8b991bb8 (diff)
[Apex] Move Functest Scenario selection to script
When using 'shell' builder directly '{}' is interpreted as a JJB substitution. This can be escaped with '{{}}' but breaks due to Apex use of Jinja2. Moving the entire script to a shell fixes this issue. Change-Id: I874a45cf25ca69373275849f98c89c534f3de0bb Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Diffstat (limited to 'jjb/apex/apex-functest-scenario.sh')
-rw-r--r--jjb/apex/apex-functest-scenario.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/jjb/apex/apex-functest-scenario.sh b/jjb/apex/apex-functest-scenario.sh
new file mode 100644
index 000000000..dcbed4479
--- /dev/null
+++ b/jjb/apex/apex-functest-scenario.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+set -o errexit
+set -o nounset
+set -o pipefail
+
+features=$(echo $DEPLOY_SCENARIO | sed -r -n 's/os-.+-(.+)-(noha|ha)/\1/p')
+if [ "$features" == 'rocky' ]; then
+ functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-rocky-(noha|ha)/\1-nofeature-\2/p')
+ echo "DOCKER_TAG=hunter" > functest_scenario
+elif [[ "$features" =~ 'rocky' ]]; then
+ functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-(.+)_rocky-(noha|ha)/\1-\2-\3/p')
+ echo "DOCKER_TAG=hunter" > functest_scenario
+else
+ functest_scenario=$DEPLOY_SCENARIO
+ echo "DOCKER_TAG=$([[ ${BRANCH##*/} == "master" ]] && \
+ echo "latest" || echo ${BRANCH##*/})" > functest_scenario
+fi
+echo "DEPLOY_SCENARIO=$functest_scenario" >> functest_scenario