mirror of
https://github.com/YunoHost-Apps/lychee_ynh.git
synced 2024-09-03 19:36:36 +02:00
Fix upgrade (#26)
* Backup before any upgrade step * Use $YNH_PHP_VERSION, not the maybe old one, in upgrade
This commit is contained in:
parent
f7b9d8ccfa
commit
3f1325345f
1 changed files with 15 additions and 15 deletions
|
@ -22,7 +22,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
public_path=$(ynh_app_setting_get --app=$app --key=public_path)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
phpversion=$YNH_PHP_VERSION
|
||||
version=ynh_app_upstream_version
|
||||
|
||||
#=================================================
|
||||
|
@ -31,6 +31,20 @@ version=ynh_app_upstream_version
|
|||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up Lychee before upgrading..." --weight=3
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
|
@ -63,20 +77,6 @@ if ynh_legacy_permissions_exists; then
|
|||
ynh_app_setting_delete --app=$app --key=is_public
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up Lychee before upgrading..." --weight=3
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue