CI: validate modular upgrade (loader + upgrade_modules). Loader: default to stable, support both branches.

- CI: when upgrade_modules/ exists, check all 12 modules and grep Branch_Check in modules
- CI: syntax-check upgrade_modules/*.sh in validate-shell and validate-on-os
- Loader: BRANCH_FOR_MODULES default 'stable' so one-liner works without -b
- Loader: show both stable and -b v2.5.5-dev in root-check message
This commit is contained in:
master3395
2026-02-15 19:38:15 +01:00
parent 6d932c7d41
commit a2331c5d14
2 changed files with 32 additions and 5 deletions

View File

@@ -23,6 +23,14 @@ jobs:
echo "OK $f"
done
test -f preUpgrade.sh && test -f cyberpanel_upgrade.sh || { echo "Missing required scripts"; exit 1; }
if [ -d upgrade_modules ]; then
echo "=== Upgrade modules syntax ==="
for f in upgrade_modules/*.sh; do
[ -f "$f" ] || continue
bash -n "$f" || { echo "FAIL (syntax): $f"; exit 1; }
echo "OK $f"
done
fi
echo "All shell scripts passed syntax check"
validate-python:
@@ -57,7 +65,15 @@ jobs:
test -f "$f" || { echo "Missing: $f"; exit 1; }
done
grep -q 'BRANCH_NAME' preUpgrade.sh || exit 1
grep -q 'Branch_Name\|download_install_phpmyadmin\|Branch_Check' cyberpanel_upgrade.sh || exit 1
if [ -d upgrade_modules ]; then
for n in 00_common 01_variables 02_checks 03_mariadb 04_git_url 05_repository 06_components 07_branch_input 08_main_upgrade 09_sync 10_post_tweak 11_display_final; do
test -f "upgrade_modules/${n}.sh" || { echo "Missing: upgrade_modules/${n}.sh"; exit 1; }
done
grep -q 'Branch_Check\|Branch_Name' upgrade_modules/00_common.sh upgrade_modules/02_checks.sh || exit 1
grep -q 'upgrade_modules\|Pre_Upgrade_Branch_Input\|Set_Default_Variables' cyberpanel_upgrade.sh || exit 1
else
grep -q 'Branch_Name\|download_install_phpmyadmin\|Branch_Check' cyberpanel_upgrade.sh || exit 1
fi
echo "Key files OK"
# Run validation inside a container per supported OS (AlmaLinux, CentOS, CloudLinux, Debian, RHEL, Rocky, Ubuntu).
@@ -121,6 +137,16 @@ jobs:
for f in preUpgrade.sh cyberpanel_upgrade.sh plogical/upgrade.py install/install.py plogical/versionFetcher.py; do
test -f "$f" || { echo "Missing: $f"; exit 1; }
done
grep -q "BRANCH_NAME" preUpgrade.sh && grep -q "Branch_Name\|download_install_phpmyadmin\|Branch_Check" cyberpanel_upgrade.sh || exit 1
grep -q "BRANCH_NAME" preUpgrade.sh || exit 1
if [ -d upgrade_modules ]; then
for n in 00_common 01_variables 02_checks 03_mariadb 04_git_url 05_repository 06_components 07_branch_input 08_main_upgrade 09_sync 10_post_tweak 11_display_final; do
test -f "upgrade_modules/${n}.sh" || { echo "Missing: upgrade_modules/${n}.sh"; exit 1; }
done
grep -q "Branch_Check\|Branch_Name" upgrade_modules/00_common.sh upgrade_modules/02_checks.sh || exit 1
grep -q "upgrade_modules\|Pre_Upgrade_Branch_Input\|Set_Default_Variables" cyberpanel_upgrade.sh || exit 1
for f in upgrade_modules/*.sh; do [ -f "$f" ] && bash -n "$f" || exit 1; done
else
grep -q "Branch_Name\|download_install_phpmyadmin\|Branch_Check" cyberpanel_upgrade.sh || exit 1
fi
echo "Done."
'