Merge pull request #2343 from nextcloud/enh/noid/update-run-twice

sometimes the built-in upgrader needs to run several times
This commit is contained in:
Simon L 2023-04-15 17:42:14 +02:00 committed by GitHub
commit efd6f2a738
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -260,6 +260,20 @@ DATADIR_PERMISSION_CONF
touch "$NEXTCLOUD_DATA_DIR/install.failed"
exit 1
fi
# shellcheck disable=SC2016
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
INSTALLED_MAJOR="${installed_version%%.*}"
IMAGE_MAJOR="${image_version%%.*}"
if ! [ "$INSTALLED_MAJOR" -gt "$IMAGE_MAJOR" ]; then
php /var/www/html/occ config:system:set updater.release.channel --value=beta
php /var/www/html/occ config:system:set updatedirectory --value="/nc-updater"
php /var/www/html/updater/updater.phar --no-interaction
if ! php /var/www/html/occ -V || php /var/www/html/occ status | grep maintenance | grep -q 'true'; then
echo "Installation of Nextcloud failed!"
touch "$NEXTCLOUD_DATA_DIR/install.failed"
exit 1
fi
fi
php /var/www/html/occ config:system:set updater.release.channel --value=stable
php /var/www/html/occ db:add-missing-indices
php /var/www/html/occ db:add-missing-columns