Function override_xci_flavor exits with 0 early, preventing
the rest of the script and especially override_scenario function
to run. This makes it impossible to verify patches that contains
installer-type or deploy-scenario in commit message since the
generated scenario.properties file contains only XCI_FLAVOR in
it, causing verify jobs to fail determining the installer type
and the scenario. See the example.
https://build.opnfv.org/ci/job/xci-verify-ubuntu-virtual-master/2937/console
This change removes exit 0 from override_xci_flavor and moves
the call to it to after override_scenario function.
JIRA: XCI-21
Change-Id: Ic7f943ba5e1562177b59a8215cd8a6f2a58db093
Signed-off-by: Fatih Degirmenci <fdegir@gmail.com>
if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment|force-verify ]]; then
[[ "$GERRIT_TOPIC" =~ force-verify ]] && echo "Forcing CI verification using default scenario and installer!"
[[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]] && echo "Skipping verification!"
if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment|force-verify ]]; then
[[ "$GERRIT_TOPIC" =~ force-verify ]] && echo "Forcing CI verification using default scenario and installer!"
[[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]] && echo "Skipping verification!"
- echo "INSTALLER_TYPE=osa" > $WORK_DIRECTORY/scenario.properties
+ echo "INSTALLER_TYPE=osa" >> $WORK_DIRECTORY/scenario.properties
echo "DEPLOY_SCENARIO=os-nosdn-nofeature" >> $WORK_DIRECTORY/scenario.properties
echo "XCI_SHA=$XCI_SHA" >> $WORK_DIRECTORY/scenario.properties
echo "SCENARIO_SHA=$SCENARIO_SHA" >> $WORK_DIRECTORY/scenario.properties
echo "PROJECT_NAME=$GERRIT_PROJECT" >> $WORK_DIRECTORY/scenario.properties
echo "DEPLOY_SCENARIO=os-nosdn-nofeature" >> $WORK_DIRECTORY/scenario.properties
echo "XCI_SHA=$XCI_SHA" >> $WORK_DIRECTORY/scenario.properties
echo "SCENARIO_SHA=$SCENARIO_SHA" >> $WORK_DIRECTORY/scenario.properties
echo "PROJECT_NAME=$GERRIT_PROJECT" >> $WORK_DIRECTORY/scenario.properties
+ log_scenario_properties
echo "Installer type or deploy scenario is not specified. Falling back to programmatically determining them."
else
echo "Recording the installer '$INSTALLER_TYPE' and scenario '$DEPLOY_SCENARIO' for downstream jobs"
echo "Installer type or deploy scenario is not specified. Falling back to programmatically determining them."
else
echo "Recording the installer '$INSTALLER_TYPE' and scenario '$DEPLOY_SCENARIO' for downstream jobs"
- echo "INSTALLER_TYPE=$INSTALLER_TYPE" > $WORK_DIRECTORY/scenario.properties
+ echo "INSTALLER_TYPE=$INSTALLER_TYPE" >> $WORK_DIRECTORY/scenario.properties
echo "DEPLOY_SCENARIO=$DEPLOY_SCENARIO" >> $WORK_DIRECTORY/scenario.properties
echo "XCI_SHA=$XCI_SHA" >> $WORK_DIRECTORY/scenario.properties
echo "SCENARIO_SHA=$SCENARIO_SHA" >> $WORK_DIRECTORY/scenario.properties
echo "PROJECT_NAME=$GERRIT_PROJECT" >> $WORK_DIRECTORY/scenario.properties
echo "DEPLOY_SCENARIO=$DEPLOY_SCENARIO" >> $WORK_DIRECTORY/scenario.properties
echo "XCI_SHA=$XCI_SHA" >> $WORK_DIRECTORY/scenario.properties
echo "SCENARIO_SHA=$SCENARIO_SHA" >> $WORK_DIRECTORY/scenario.properties
echo "PROJECT_NAME=$GERRIT_PROJECT" >> $WORK_DIRECTORY/scenario.properties
+ log_scenario_properties
XCI_FLAVOR='mini'
echo "XCI flavor is not specified. The default is specified instead (i.e. mini). Falling back to programmatically determining them."
echo "XCI_FLAVOR=mini" >> $WORK_DIRECTORY/scenario.properties
XCI_FLAVOR='mini'
echo "XCI flavor is not specified. The default is specified instead (i.e. mini). Falling back to programmatically determining them."
echo "XCI_FLAVOR=mini" >> $WORK_DIRECTORY/scenario.properties
else
echo "Recording the XCI flavor '$XCI_FLAVOR' for downstream jobs"
echo "XCI_FLAVOR=$XCI_FLAVOR" >> $WORK_DIRECTORY/scenario.properties
else
echo "Recording the XCI flavor '$XCI_FLAVOR' for downstream jobs"
echo "XCI_FLAVOR=$XCI_FLAVOR" >> $WORK_DIRECTORY/scenario.properties
fi
else
XCI_FLAVOR='mini'
echo "XCI flavor is not specified. The default is specified instead (i.e. mini). Falling back to programmatically determining them."
echo "XCI_FLAVOR=mini" >> $WORK_DIRECTORY/scenario.properties
fi
else
XCI_FLAVOR='mini'
echo "XCI flavor is not specified. The default is specified instead (i.e. mini). Falling back to programmatically determining them."
echo "XCI_FLAVOR=mini" >> $WORK_DIRECTORY/scenario.properties
+function log_scenario_properties() {
+ echo "Processing $GERRIT_PROJECT patchset $GERRIT_REFSPEC"
+ echo "-------------------------------------------------------------------------"
+ cat $WORK_DIRECTORY/scenario.properties
+ echo "-------------------------------------------------------------------------"
+}
+
echo "Determining the impacted scenario"
declare -a DEPLOY_SCENARIO
echo "Determining the impacted scenario"
declare -a DEPLOY_SCENARIO
determine_default_scenario
else
determine_scenario
determine_default_scenario
else
determine_scenario
override_scenario
# ensure single scenario is impacted
override_scenario
# ensure single scenario is impacted