mirror of
https://github.com/YunoHost-Apps/mobilizon_ynh.git
synced 2024-09-03 19:46:19 +02:00
Fix upgrade steps
This commit is contained in:
parent
c173ad82f9
commit
a841258586
1 changed files with 18 additions and 0 deletions
|
@ -71,6 +71,7 @@ ynh_print_info --message="Backing up the app before upgrading (may take a while)
|
|||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
read -p "key"
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
ynh_clean_check_starting
|
||||
|
@ -94,9 +95,26 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd
|
|||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading source files..." --time --weight=1
|
||||
|
||||
# Create a temporary directory
|
||||
tmpdir="$(mktemp -d)"
|
||||
|
||||
# Backup the config file in the temp dir
|
||||
cp -a "$final_path/$app/.env" "$tmpdir/.env"
|
||||
cp -a "$final_path/$app/config/prod.exs" "$tmpdir/prod.exs"
|
||||
|
||||
# Remove the app directory securely
|
||||
ynh_secure_remove --file="$final_path/$app"
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path/$app"
|
||||
|
||||
#Copy the admin saved settings from tmp directory to final path
|
||||
cp -a "$tmpdir/.env" "$final_path/$app/.env"
|
||||
cp -a "$tmpdir/prod.exs" "$final_path/$app/config/prod.exs"
|
||||
|
||||
# Remove the tmp directory securely
|
||||
ynh_secure_remove --file="$tmpdir"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue