diff --git a/master-libvirt/master.cfg b/master-libvirt/master.cfg index f8b2b78b..68dd0734 100644 --- a/master-libvirt/master.cfg +++ b/master-libvirt/master.cfg @@ -14,6 +14,8 @@ import docker import os import sys +from constants import * + sys.setrecursionlimit(10000) sys.path.insert(0, "/srv/buildbot/master") @@ -212,6 +214,7 @@ def getDebInstallStep(): "systemdCapability", "test_mode", "test_type", + "prev_major_version", "version_name", ] ), @@ -228,6 +231,21 @@ def getMajorVersionStep(): ), ) +def getDebUpgradeVersionSteps(f_deb_upgrade_steps): + current_major_version = util.Interpolate(f"%(prop:major_version)s") + rtn_steps = util.BuildFactory() + for cur_branch in branches_main: + if current_major_version == cur_branch: + break + + f_deb_upgrade_steps.addStep( + steps.SetProperty( + property="prev_major_version", + value=cur_branch + ) + ) + + f_deb_upgrade_steps.addStep(getDebUpgradeStep()) # FACTORY @@ -243,6 +261,9 @@ f_deb_upgrade.addStep(getMajorVersionStep()) f_deb_upgrade.addStep(getScript("deb-upgrade.sh")) f_deb_upgrade.addStep(getDebUpgradeStep()) +## f_deb_upgrade_from_version +getDebUpgradeVersionSteps(f_deb_upgrade) + ## f_rpm_install f_rpm_install = util.BuildFactory() f_rpm_install.addStep(getScript("rpm-install.sh")) diff --git a/scripts/deb-upgrade.sh b/scripts/deb-upgrade.sh index cb04f208..7c8a6291 100755 --- a/scripts/deb-upgrade.sh +++ b/scripts/deb-upgrade.sh @@ -15,7 +15,13 @@ set -e manual_run_switch "$1" upgrade_type_mode -upgrade_test_type "$test_type" + +# If there is available previous major version +# then expect that it will be used as base of +# installation +if [ -z "${prev_major_version}" ]; then + upgrade_test_type "$test_type" +fi bb_print_env