Find the right release file for ffu mixed version upgrade.
By setting ffu_overcloud_upgrade in the featureset this change find the right previous version for ffu and thus the correct release file. This also refactor all the upgrade/update related function. This whole section of the ci code is related to this tech-debt. Related-Bug: #1749978 Change-Id: I962c2e4ad4eb522839deb904e0c67fb6a5d0ead9
This commit is contained in:
parent
5fa75fc352
commit
33afffa972
|
@ -1,8 +1,23 @@
|
||||||
function previous_release_from {
|
function previous_release_from {
|
||||||
# works even when $1 is empty string or not provided at all
|
local release="${1:-master}"
|
||||||
local RELEASE="$1"
|
local type="${2:-mixed_upgrade}"
|
||||||
|
local previous_version=""
|
||||||
|
case "${type}" in
|
||||||
|
'mixed_upgrade')
|
||||||
|
previous_version=$(previous_release_mixed_upgrade_case "${release}");;
|
||||||
|
'ffu_upgrade')
|
||||||
|
previous_version=$(previous_release_ffu_upgrade_case "${release}");;
|
||||||
|
*)
|
||||||
|
echo "UNKNOWN_TYPE"
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo "${previous_version}"
|
||||||
|
}
|
||||||
|
|
||||||
case "$RELEASE" in
|
function previous_release_mixed_upgrade_case {
|
||||||
|
local release="${1:-master}"
|
||||||
|
case "${release}" in
|
||||||
''|master)
|
''|master)
|
||||||
# NOTE: we need to update this when we cut a stable branch
|
# NOTE: we need to update this when we cut a stable branch
|
||||||
echo "queens"
|
echo "queens"
|
||||||
|
@ -26,16 +41,29 @@ function previous_release_from {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_featureset_mixed_upgrade {
|
function previous_release_ffu_upgrade_case {
|
||||||
local FEATURESET_FILE="$1"
|
local release="${1:-master}"
|
||||||
|
|
||||||
[ $(shyaml get-value mixed_upgrade "False"< $FEATURESET_FILE) = "True" ]
|
case "${release}" in
|
||||||
|
''|master)
|
||||||
|
# NOTE: we need to update this when we cut a stable branch
|
||||||
|
echo "newton"
|
||||||
|
;;
|
||||||
|
queens)
|
||||||
|
echo "newton"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "INVALID_RELEASE_FOR_FFU"
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_featureset_overcloud_update {
|
function is_featureset {
|
||||||
local FEATURESET_FILE="$1"
|
local type="${1}"
|
||||||
|
local featureset_file="${2}"
|
||||||
|
|
||||||
[ $(shyaml get-value overcloud_update "False"< $FEATURESET_FILE) = "True" ]
|
[ $(shyaml get-value "${type}" "False"< "${featureset_file}") = "True" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_with_timeout {
|
function run_with_timeout {
|
||||||
|
|
|
@ -127,17 +127,22 @@ for JOB_TYPE_PART in $(sed 's/-/ /g' <<< "${TOCI_JOBTYPE:-}") ; do
|
||||||
featureset*)
|
featureset*)
|
||||||
FEATURESET_FILE="$LWD/config/general_config/$JOB_TYPE_PART.yml"
|
FEATURESET_FILE="$LWD/config/general_config/$JOB_TYPE_PART.yml"
|
||||||
FEATURESET_CONF="$FEATURESET_CONF --extra-vars @$FEATURESET_FILE"
|
FEATURESET_CONF="$FEATURESET_CONF --extra-vars @$FEATURESET_FILE"
|
||||||
|
MIXED_UPGRADE_TYPE=''
|
||||||
|
# Order matters. ffu featureset has both mixed version and ffu_overcloud_upgrade.
|
||||||
|
if is_featureset ffu_overcloud_upgrade "$TRIPLEO_ROOT/tripleo-quickstart/config/general_config/$JOB_TYPE_PART.yml"; then
|
||||||
|
MIXED_UPGRADE_TYPE='ffu_upgrade'
|
||||||
|
elif is_featureset mixed_upgrade "$TRIPLEO_ROOT/tripleo-quickstart/config/general_config/$JOB_TYPE_PART.yml"; then
|
||||||
|
MIXED_UPGRADE_TYPE='mixed_upgrade'
|
||||||
|
elif is_featureset overcloud_update "$TRIPLEO_ROOT/tripleo-quickstart/config/general_config/$JOB_TYPE_PART.yml"; then
|
||||||
|
TAGS="$TAGS,overcloud-update"
|
||||||
|
fi
|
||||||
# Set UPGRADE_RELEASE if applicable
|
# Set UPGRADE_RELEASE if applicable
|
||||||
if is_featureset_mixed_upgrade "$TRIPLEO_ROOT/tripleo-quickstart/config/general_config/$JOB_TYPE_PART.yml"; then
|
if [ -n "${MIXED_UPGRADE_TYPE}" ]; then
|
||||||
export UPGRADE_RELEASE=$(previous_release_from "$STABLE_RELEASE")
|
export UPGRADE_RELEASE=$(previous_release_from "${STABLE_RELEASE}" "${MIXED_UPGRADE_TYPE}")
|
||||||
QUICKSTART_RELEASE="$QUICKSTART_RELEASE-undercloud-$UPGRADE_RELEASE-overcloud"
|
QUICKSTART_RELEASE="$QUICKSTART_RELEASE-undercloud-$UPGRADE_RELEASE-overcloud"
|
||||||
# Run overcloud-upgrade tag only in upgrades jobs
|
# Run overcloud-upgrade tag only in upgrades jobs
|
||||||
TAGS="$TAGS,overcloud-upgrade"
|
TAGS="$TAGS,overcloud-upgrade"
|
||||||
fi
|
fi
|
||||||
if is_featureset_overcloud_update "$TRIPLEO_ROOT/tripleo-quickstart/config/general_config/$JOB_TYPE_PART.yml"; then
|
|
||||||
TAGS="$TAGS,overcloud-update"
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
ovb)
|
ovb)
|
||||||
OVB=1
|
OVB=1
|
||||||
|
|
Loading…
Reference in New Issue