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

upgrade/restore

This commit is contained in:
Thomas 2023-03-02 20:37:23 +01:00 committed by GitHub
parent 9f14e2ac5f
commit ebfb32aebd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 18 deletions

View file

@ -31,10 +31,10 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
# BACKUP SYSTEMD
#=================================================
ynh_backup --src_path="/etc/systemd/system/${app}-beat.service"
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.target"
ynh_backup --src_path="/etc/systemd/system/${app}.service"
ynh_backup --src_path="/etc/systemd/system/${app}_workers.service"
#=================================================
# BACKUP THE POSTGRESQL DATABASE

View file

@ -37,39 +37,34 @@ ynh_restore_file --origin_path="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chown -R $app: "$install_dir"
#=================================================
# RESTORE SYSTEMD
#=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
ynh_restore_file --origin_path="/etc/systemd/system/${app}-beat.service"
ynh_restore_file --origin_path="/etc/systemd/system/${app}-server.service"
ynh_restore_file --origin_path="/etc/systemd/system/${app}-worker.service"
ynh_restore_file --origin_path="/etc/systemd/system/$app.target"
ynh_restore_file --origin_path="/etc/systemd/system/${app}.service"
ynh_restore_file --origin_path="/etc/systemd/system/${app}_workers.service"
systemctl enable "${app}-beat.service" --quiet
systemctl enable "${app}-server.service" --quiet
systemctl enable "${app}-worker.service" --quiet
systemctl enable "${app}.service" --quiet
systemctl enable "${app}_workers.service" --quiet
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add "${app}-beat"
yunohost service add "${app}-server"
yunohost service add "${app}-worker"
yunohost service add "${app}"
yunohost service add "${app}_workers"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="systemd" --line_match="Started"
ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid"
ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="ready"
ynh_systemd_action --service_name="${app}" --action="start" --log_path="/var/log/$app/$app.log" --line_match="Booting worker with pid"
ynh_systemd_action --service_name="${app}_workers" --action="start" --log_path="systemd" --line_match="ready"
#=================================================
# GENERIC FINALIZATION