Skip to content

Commit

Permalink
Merge pull request #3915 from nextcloud/enh/3908/use-correct-update-way
Browse files Browse the repository at this point in the history
  • Loading branch information
szaimen authored Dec 12, 2023
2 parents 436a5e8 + fe669a0 commit 7c0c6d6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Containers/nextcloud/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,15 @@ DATADIR_PERMISSION_CONF
unset ADMIN_PASSWORD

if [ "$INSTALL_LATEST_MAJOR" = yes ]; 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
INSTALLED_AT="$(php /var/www/html/occ config:app:get core installedat)"
if [ -n "${INSTALLED_AT}" ]; then
# Set the installdat to 00 which will allow to skip staging and install the next major directly
# shellcheck disable=SC2001
INSTALLED_AT="$(echo "${INSTALLED_AT}" | sed "s|[0-9][0-9]$|00|")"
php /var/www/html/occ config:app:set core installedat --value="${INSTALLED_AT}"
fi
php /var/www/html/updater/updater.phar --no-interaction --no-backup
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"
Expand All @@ -269,7 +275,7 @@ DATADIR_PERMISSION_CONF
INSTALLED_MAJOR="${installed_version%%.*}"
IMAGE_MAJOR="${image_version%%.*}"
if ! [ "$INSTALLED_MAJOR" -gt "$IMAGE_MAJOR" ]; then
php /var/www/html/updater/updater.phar --no-interaction
php /var/www/html/updater/updater.phar --no-interaction --no-backup
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"
Expand All @@ -280,7 +286,6 @@ DATADIR_PERMISSION_CONF
fi
php /var/www/html/occ app:disable updatenotification
rm -rf /var/www/html/apps/updatenotification
php /var/www/html/occ config:system:set updater.release.channel --value=stable
php /var/www/html/occ app:enable nextcloud-aio --force
php /var/www/html/occ db:add-missing-indices
php /var/www/html/occ db:add-missing-columns
Expand Down

0 comments on commit 7c0c6d6

Please sign in to comment.