mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
fix upgrade
This commit is contained in:
parent
2667722dc9
commit
74f3112fea
3 changed files with 22 additions and 21 deletions
|
@ -273,7 +273,12 @@ exec_occ background:cron
|
|||
# POST-INSTALL MAINTENANCE
|
||||
#=================================================
|
||||
|
||||
(cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices ; sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log")
|
||||
(
|
||||
cd $final_path
|
||||
sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices
|
||||
sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns
|
||||
sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n
|
||||
)
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE THE HOOK FILE FOR USER CREATE
|
||||
|
|
|
@ -229,6 +229,8 @@ then
|
|||
source upgrade.d/upgrade.last.sh
|
||||
last_version=$next_version
|
||||
|
||||
last_major_version=${last_version%%.*}
|
||||
|
||||
# Set write access for the following commands
|
||||
chown -R $app: "$final_path" "$datadir"
|
||||
|
||||
|
@ -240,23 +242,19 @@ then
|
|||
do
|
||||
|
||||
# The major version is the first part of the version number
|
||||
# major_version=${next_version%%.*}
|
||||
major_version=${last_version%%.*}
|
||||
current_major_version=${current_version%%.*}
|
||||
|
||||
# Load the value for this version
|
||||
source upgrade.d/upgrade.$current_major_version.sh
|
||||
|
||||
# If the current version has the same major version than the next one,
|
||||
# then it's the last upgrade to do
|
||||
# We also cover the case where the last version is the first of the current major version series
|
||||
# (e.g. 19.0.0 is the latest version)
|
||||
if [[ ("$major_version" -eq "$current_major_version") || ( ("$major_version" -eq "$((current_major_version+1))") && ("$next_version" == "$last_version") ) ]]; then
|
||||
current_major_version=last
|
||||
# Execute the commands dedicated to the last upgrade
|
||||
last_upgrade_operations
|
||||
if [ "$last_major_version" -eq "$current_major_version" ]; then
|
||||
current_major_version=last
|
||||
# Enable YunoHost patches on Nextcloud sources
|
||||
cp -a ../sources/patches_last_version/* ../sources/patches
|
||||
fi
|
||||
|
||||
# Load the value for this version
|
||||
source upgrade.d/upgrade.$current_major_version.sh
|
||||
|
||||
ynh_print_info --message="Upgrade to nextcloud $next_version"
|
||||
|
||||
# Create an app.src for this version of nextcloud
|
||||
|
@ -311,6 +309,13 @@ then
|
|||
exec_occ -V
|
||||
done
|
||||
|
||||
(
|
||||
cd $final_path
|
||||
sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices
|
||||
sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns
|
||||
sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n
|
||||
)
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE NEXTCLOUD
|
||||
#=================================================
|
||||
|
|
|
@ -5,12 +5,3 @@ next_version="19.0.1"
|
|||
|
||||
# Nextcloud tarball checksum sha256
|
||||
nextcloud_source_sha256="4ef311e00d939915d3a9714cd3a1ad436db9157e04620e4a88c2f427e5e65b2d"
|
||||
|
||||
# This function will only be executed upon applying the last upgrade referenced above
|
||||
last_upgrade_operations () {
|
||||
# Patch nextcloud files only for the last version
|
||||
cp -a ../sources/patches_last_version/* ../sources/patches
|
||||
|
||||
# Execute post-upgrade operations later on
|
||||
(cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns ; sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log")
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue