diff options
Diffstat (limited to 'jjb/xci/xci-set-scenario.sh')
-rwxr-xr-x | jjb/xci/xci-set-scenario.sh | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/jjb/xci/xci-set-scenario.sh b/jjb/xci/xci-set-scenario.sh index c3012cd88..c28093d27 100755 --- a/jjb/xci/xci-set-scenario.sh +++ b/jjb/xci/xci-set-scenario.sh @@ -7,7 +7,6 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -set -o errexit set -o pipefail #---------------------------------------------------------------------- @@ -96,23 +95,27 @@ function determine_generic_scenario() { # get the changeset cd $WORKSPACE - CHANGESET=$(git diff HEAD^..HEAD --name-only) - for CHANGED_FILE in $CHANGESET; do - case $CHANGED_FILE in - *k8-nosdn*|*kubespray*) - [[ ${DEPLOY_SCENARIO[@]} =~ "k8-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='k8-nosdn-nofeature' - ;; - *os-odl*) - [[ ${DEPLOY_SCENARIO[@]} =~ "os-odl-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-odl-nofeature' - ;; - *os-nosdn*|*osa*) - [[ ${DEPLOY_SCENARIO[@]} =~ "os-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-nosdn-nofeature' + SCENARIOS=$(git diff HEAD^..HEAD --name-only -- '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[${#DEPLOY_SCENARIO[@]}]=$CHANGED_SCENARIO + done + for CHANGED_INSTALLER in $INSTALLERS; do + case $CHANGED_INSTALLER in + kubespray) + 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 + 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[@]} -eq 0 ]] && DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-nosdn-nofeature' + fi # extract releng-xci sha XCI_SHA=$(cd $WORKSPACE && git rev-parse HEAD) |