1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/funkwhale_ynh.git synced 2024-09-03 18:36:24 +02:00

Implement --is_big

This commit is contained in:
yalh76 2021-04-06 20:43:40 +02:00
parent f6e1bea626
commit a29661ca1a
3 changed files with 20 additions and 27 deletions

View file

@ -41,13 +41,6 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
backup_core_only=$(ynh_app_setting_get --app="$app" --key=backup_core_only)
# If backup_core_only have any value in the settings.yml file, do not backup the data directory
if [ ! "$backup_core_only" ]
then
ynh_backup --src_path="$datadir"
fi
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
#================================================= #=================================================
@ -74,6 +67,12 @@ ynh_backup --src_path="/etc/systemd/system/${app}-server.service"
ynh_backup --src_path="/etc/systemd/system/${app}-worker.service" ynh_backup --src_path="/etc/systemd/system/${app}-worker.service"
ynh_backup --src_path="/etc/systemd/system/$app.target" ynh_backup --src_path="/etc/systemd/system/$app.target"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="$datadir" --is_big
#================================================= #=================================================
# BACKUP THE POSTGRESQL DATABASE # BACKUP THE POSTGRESQL DATABASE
#================================================= #=================================================

View file

@ -59,24 +59,8 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
ynh_script_progression --message="Restoring the app main directory..." ynh_script_progression --message="Restoring the app main directory..."
backup_core_only=$(ynh_app_setting_get --app=$app --key=backup_core_only)
# If backup_core_only have any value, then restore only code
if [ ! "$backup_core_only" ]
then
ynh_restore_file --origin_path="$datadir"
fi
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
# Remove the option backup_core_only if it's in the settings.yml file
ynh_app_setting_delete --app=$app --key=backup_core_only
mkdir -p $datadir
pushd $datadir
mkdir -p static media music
popd
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
@ -92,7 +76,6 @@ ynh_script_progression --message="Restoring user rights..."
# Restore permissions on app files # Restore permissions on app files
chown -R $app: $final_path chown -R $app: $final_path
chown -R $app: $datadir
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
@ -145,6 +128,20 @@ ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="sys
ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Application startup complete" ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Application startup complete"
ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled" ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled"
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_script_progression --message="Restoring the various files..."
ynh_restore_file --origin_path="$datadir" --not_mandatory
mkdir -p $datadir
pushd $datadir
mkdir -p static media music
popd
chown -R $app: $datadir
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -63,9 +63,6 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
# Inform the backup/restore process that it should not save the data directory
ynh_app_setting_set --app=$app --key=backup_core_only --value=1
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
ynh_clean_setup () { ynh_clean_setup () {