diff --git a/check_process b/check_process index 8ea0523..50bfff4 100644 --- a/check_process +++ b/check_process @@ -10,6 +10,7 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=62db8a96750dfd28880126d3eb9228d4d71f0814 backup_restore=1 multi_instance=1 # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. diff --git a/scripts/backup b/scripts/backup index e8307c5..a02cbca 100644 --- a/scripts/backup +++ b/scripts/backup @@ -38,7 +38,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= ynh_print_info --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped wikijs service" +ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped wikijs service" #================================================= # BACKUP THE APP MAIN DIR @@ -75,7 +75,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:" +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="HTTP Server:" #================================================= # END OF SCRIPT diff --git a/scripts/change_url b/scripts/change_url index 59de0e0..aa221dd 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -75,7 +75,7 @@ fi #================================================= ynh_print_info --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped wikijs service" +ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped wikijs service" #================================================= # MODIFY URL IN NGINX CONF @@ -113,7 +113,7 @@ fi #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:" +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="HTTP Server:" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 9c0ce57..b91af54 100644 --- a/scripts/install +++ b/scripts/install @@ -169,7 +169,7 @@ yunohost service add $app --description "$app daemon for Wiki.js" --log_type sys # START SYSTEMD SERVICE #================================================= -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:" +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="HTTP Server:" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index ce472a0..54ab6d5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -116,7 +116,7 @@ yunohost service add $app --description "$app daemon for Wiki.js" --log_type sys #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:" +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="HTTP Server:" #================================================= # CREATE LDAP USER diff --git a/scripts/upgrade b/scripts/upgrade index afa2fa0..e39d226 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -86,6 +86,10 @@ 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 + +#Workaround to be remove in next version +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="HTTP Server:" + ynh_clean_setup () { # restore it if the upgrade fails ynh_restore_upgradebackup @@ -101,7 +105,7 @@ ynh_abort_if_errors #================================================= ynh_print_info --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped wikijs service" +ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped wikijs service" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -111,8 +115,16 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_print_info --message="Upgrading source files..." + config_file="$final_path/config.yml" + tmpdir="$(mktemp -d)" + + rsync -a "$config_file" "$tmpdir/." + ynh_secure_remove --file="$final_path" + # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" + + rsync -a "$tmpdir/config.yml" "$final_path/." fi #================================================= @@ -196,7 +208,7 @@ fi #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:" +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="HTTP Server:" #================================================= # RELOAD NGINX