Browse Source

Fix upgrade from previous version

pull/253/head
Jimmy Monin 6 years ago
parent
commit
5310fd9f3a
  1. 6
      check_process
  2. 18
      scripts/_ynh_add_fpm_config
  3. 20
      scripts/upgrade
  4. 4
      scripts/upgrade.d/upgrade.15.sh
  5. 13
      scripts/upgrade.d/upgrade.16.sh
  6. 13
      scripts/upgrade.d/upgrade.17.sh

6
check_process

@ -12,7 +12,7 @@
setup_private=0 setup_private=0
setup_public=0 setup_public=0
upgrade=1 upgrade=1
upgrade=1 from_commit=1cdb9ea1619c6acaaa90bae88b5c4bed5084a2a7
upgrade=1 from_commit=9c57c2f78f3da979d587d708eb9379ffaa41bcfa
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
incorrect_path=1 incorrect_path=1
@ -24,6 +24,6 @@
Email= Email=
Notification=none Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=1cdb9ea1619c6acaaa90bae88b5c4bed5084a2a7
name= Fix Debian Stretch dependencies by installing php-apcu, php-mbstring …
; commit=9c57c2f78f3da979d587d708eb9379ffaa41bcfa
name=Do not use too much process for php (#247)
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&user_home=1& manifest_arg=domain=DOMAIN&path=PATH&admin=USER&user_home=1&

18
scripts/_ynh_add_fpm_config

@ -125,4 +125,22 @@ ynh_add_fpm_config () {
ynh_store_file_checksum "$finalphpini" ynh_store_file_checksum "$finalphpini"
fi fi
ynh_systemd_action --service_name=$fpm_service --action=reload ynh_systemd_action --service_name=$fpm_service --action=reload
# Clean other php version config files for this app. Used for migration purpose.
if [ -e "/etc/php5/fpm/pool.d/$app.conf" ]
then
ynh_secure_remove --file="/etc/php5/fpm/pool.d/$app.conf"
ynh_systemd_action --service_name=php5-fpm --action=reload
fi
for i in `seq 0 4`
do
if [ "$phpversion" != "7.$i" ]
then
if [ -e "/etc/php/7.$i/fpm/pool.d/$app.conf" ]
then
ynh_secure_remove --file="/etc/php/7.$i/fpm/pool.d/$app.conf"
ynh_systemd_action --service_name=php7.$i-fpm --action=reload
fi
fi
done
} }

20
scripts/upgrade

@ -132,6 +132,16 @@ fi
# Normalize the URL path syntax # Normalize the URL path syntax
path_url=$(ynh_normalize_url_path --path_url=$path_url) path_url=$(ynh_normalize_url_path --path_url=$path_url)
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=7
ynh_install_app_dependencies $pkg_dependencies
ynh_remove_php
ynh_install_php --phpversion="$php_version" --package="$extra_pkg_dependencies"
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================
@ -178,16 +188,6 @@ if [ -f /etc/php/$php_version/fpm/conf.d/20-$app.ini ]; then
ynh_secure_remove --file=/etc/php/$php_version/fpm/conf.d/20-$app.ini ynh_secure_remove --file=/etc/php/$php_version/fpm/conf.d/20-$app.ini
fi fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=7
ynh_install_app_dependencies $pkg_dependencies
ynh_remove_php
ynh_install_php --phpversion="$php_version" --package="$extra_pkg_dependencies"
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================

4
scripts/upgrade.d/upgrade.15.sh

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Last available nextcloud version # Last available nextcloud version
next_version="15.0.11"
next_version="16.0.0"
# Nextcloud tarball checksum sha256 # Nextcloud tarball checksum sha256
nextcloud_source_sha256="59cdde8e7a4a15606efc246e37adf6401b0b4a60f33289be8725d675b9c2ae26"
nextcloud_source_sha256="4532f7028b1d9bf060f75ac4fbbde52a59ecd9c9155f3178a038d3cf3609402e"

13
scripts/upgrade.d/upgrade.16.sh

@ -1,16 +1,7 @@
#!/bin/bash #!/bin/bash
# Last available nextcloud version # Last available nextcloud version
next_version="16.0.5"
next_version="17.0.0"
# Nextcloud tarball checksum sha256 # Nextcloud tarball checksum sha256
nextcloud_source_sha256="8709c64fa776fd731c8e5f1ab25d592a2e690e5e18a81601cccf363795fae551"
# 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 occ db:add-missing-indices ; sudo -u $app php occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log")
}
nextcloud_source_sha256="6081421b33ecdb3130b2bfb2293a3f4045aeb0b471ee570e675de3d931a142a6"

13
scripts/upgrade.d/upgrade.17.sh

@ -1,16 +1,7 @@
#!/bin/bash #!/bin/bash
# Last available nextcloud version # Last available nextcloud version
next_version="17.0.0"
next_version="18.0.0"
# Nextcloud tarball checksum sha256 # Nextcloud tarball checksum sha256
nextcloud_source_sha256="6081421b33ecdb3130b2bfb2293a3f4045aeb0b471ee570e675de3d931a142a6"
# 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 occ db:add-missing-indices ; sudo -u $app php occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log")
}
nextcloud_source_sha256="194095a5586d84040bc455f77b8aa6c80f9a6a6dd713c9aebdad046713d4267b"
Loading…
Cancel
Save