summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFatih Degirmenci <fdegir@gmail.com>2018-04-11 21:16:50 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-04-11 21:16:50 +0000
commitb73e1c1f2058f6b80202d7d1a75b229c02ea858f (patch)
treee0b477cc9d09561f18b879fe811513d825330034
parent97733bc25ce3f415dd05bce4aa9f2cee8f2a11e7 (diff)
parent9743bf690567b2cf1fc079768a32213717e297e2 (diff)
Merge "jjb: xci: Only set default scenario if no scenario is set"
-rwxr-xr-xjjb/xci/xci-set-scenario.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/jjb/xci/xci-set-scenario.sh b/jjb/xci/xci-set-scenario.sh
index b591dd23c..8ef525496 100755
--- a/jjb/xci/xci-set-scenario.sh
+++ b/jjb/xci/xci-set-scenario.sh
@@ -96,22 +96,26 @@ function determine_generic_scenario() {
# get the changeset
cd $WORKSPACE
SCENARIOS=$(git diff HEAD^..HEAD --name-only -- 'xci/scenarios' | cut -d "/" -f 3 | uniq)
- # We need to set default scenario for changes that do not mess with scenarios
- NO_SCENARIOS=$(git diff HEAD^..HEAD --name-only | grep -v 'xci/scenarios' | cut -d "/" -f 3 | uniq)
+ # We need to set default scenario for changes that mess with installers
+ INSTALLERS=$(git diff HEAD^..HEAD --name-only -- 'xci/installer' | cut -d "/" -f 3 | uniq)
for CHANGED_SCENARIO in $SCENARIOS; do
- [[ ${DEPLOY_SCENARIO[@]} =~ $CHANGED_SCENARIO ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]=$CHANGED_SCENARIO
+ DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]=$CHANGED_SCENARIO
done
- for CHANGED_FILE in $NO_SCENARIOS; do
- case $CHANGED_FILE in
+ for CHANGED_INSTALLER in $INSTALLERS; do
+ case $CHANGED_INSTALLER in
kubespray)
- [[ ${DEPLOY_SCENARIO[@]} =~ "k8-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='k8-nosdn-nofeature'
+ DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='k8-nosdn-nofeature'
;;
# Default case (including OSA changes)
*)
- [[ ${DEPLOY_SCENARIO[@]} =~ "os-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-nosdn-nofeature'
+ DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-nosdn-nofeature'
;;
esac
done
+ # For all other changes, we only need to set a default scenario if it's not set already
+ if git diff HEAD^..HEAD --name-only | grep -q -v 'xci/installer\|xci/scenario'; then
+ [[ ${#DEPLOY_SCENARIO[@]} -gt 0 ]] && DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-nosdn-nofeature'
+ fi
# extract releng-xci sha
XCI_SHA=$(cd $WORKSPACE && git rev-parse HEAD)