mirror of
https://framagit.org/YunoHost-Apps/gitea_ynh.git
synced 2024-12-23 18:09:45 +01:00
Update upgrade
This commit is contained in:
parent
e26cff6a9a
commit
2f1f325a5b
@ -11,11 +11,11 @@ source ./_common.sh
|
||||
# IMPORT GENERIC HELPERS
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
# Retrieve app settings
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..."
|
||||
|
||||
domain=$(ynh_app_setting_get --app $app --key domain)
|
||||
path_url=$(ynh_normalize_url_path --path_url $(ynh_app_setting_get --app $app --key path))
|
||||
db_password=$(ynh_app_setting_get --app $app --key mysqlpwd)
|
||||
@ -28,12 +28,8 @@ upstream_version=$(ynh_app_setting_get --app $app --key upstream_version)
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=10
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
|
||||
|
||||
# We stop the service before to set ynh_clean_setup
|
||||
ynh_systemd_action --service_name=$app.service --action=stop
|
||||
|
||||
# Backup the current version of the app
|
||||
if [ "0$(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade)" -ne 1 ]
|
||||
then
|
||||
ynh_backup_before_upgrade
|
||||
@ -44,6 +40,28 @@ then
|
||||
}
|
||||
fi
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# STOP SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||
|
||||
# We stop the service before to set ynh_clean_setup
|
||||
ynh_systemd_action --service_name=$app --action="stop"
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||
|
||||
# If lfs_key doesn't exist, create it
|
||||
if [ -z "$lfs_key" ]; then
|
||||
lfs_key=$(ynh_string_random)
|
||||
ynh_app_setting_set --app=$app --key=lfs_key --value=$lfs_key
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# MIGRATION FROM GOGS
|
||||
#=================================================
|
||||
|
Loading…
Reference in New Issue
Block a user