From f19e49ae9861a93b22640f11437b749a006be2cd Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 10 Apr 2021 20:28:06 +0200 Subject: Apply example_ynh --- scripts/upgrade | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'scripts/upgrade') diff --git a/scripts/upgrade b/scripts/upgrade index b4c16e1..870bd4c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -230,14 +230,27 @@ pushd "$final_path/live" popd #================================================= -# MODIFY A CONFIG FILE +# UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Modifying a config file..." +ynh_script_progression --message="Updating a config file..." language="$(echo $language | head -c 2)" ynh_add_config --template="../conf/.env.production.sample" --destination="$config" +chmod 400 "$config" +chown $app:$app "$config" + +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Upgrading systemd configuration..." + +# Create a dedicated systemd config +ynh_add_systemd_config --service="$app-web" --template="mastodon-web.service" --others_var="port_web RBENV_ROOT" +ynh_add_systemd_config --service="$app-sidekiq" --template="mastodon-sidekiq.service" --others_var="RBENV_ROOT" +ynh_add_systemd_config --service="$app-streaming" --template="mastodon-streaming.service" --others_var="port_stream ynh_node_load_PATH ynh_node" + #================================================= # UPGRADE MASTODON #================================================= @@ -264,16 +277,6 @@ ynh_script_progression --message="Setuping the cron file..." ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." - -# Create a dedicated systemd config -ynh_add_systemd_config --service="$app-web" --template="mastodon-web.service" --others_var="port_web RBENV_ROOT" -ynh_add_systemd_config --service="$app-sidekiq" --template="mastodon-sidekiq.service" --others_var="RBENV_ROOT" -ynh_add_systemd_config --service="$app-streaming" --template="mastodon-streaming.service" --others_var="port_stream ynh_node_load_PATH ynh_node" - #================================================= # GENERIC FINALIZATION #================================================= -- cgit v1.2.3-70-g09d2