From 082854402899d698a60494a4bc47b70eba924e50 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 11 Apr 2021 20:43:53 +0200 Subject: [PATCH] Several reorder --- scripts/_common.sh | 2 +- scripts/install | 18 +++++++++--------- scripts/restore | 2 +- scripts/upgrade | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 1441eb6..d6aa49f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ # dependencies used by the app pkg_dependencies="ffmpeg postgresql postgresql-contrib openssl g++ redis-server redis-tools mailutils apt-transport-https" -YNH_NODEJS_VERSION=14 +NODEJS_VERSION=14 #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 28ed43b..65b76d2 100644 --- a/scripts/install +++ b/scripts/install @@ -82,7 +82,7 @@ ynh_exec_warn_less yunohost firewall allow TCP $rtmp_port ynh_script_progression --message="Installing dependencies..." # Install nodejs -ynh_install_nodejs --nodejs_version=$YNH_NODEJS_VERSION +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION # Install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -166,14 +166,6 @@ pushd "$final_path" ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - -# Create a dedicated systemd config -ynh_add_systemd_config --others_var="ynh_node_load_PATH" - #================================================= # ADD A CONFIGURATION #================================================= @@ -189,6 +181,14 @@ ynh_add_config --template="../conf/local-production.json" --destination="$final_ chmod 400 "$final_path/config/local-production.json" chown $app:$app "$final_path/config/local-production.json" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Configuring a systemd service..." + +# Create a dedicated systemd config +ynh_add_systemd_config --others_var="ynh_node_load_PATH" + #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/restore b/scripts/restore index 9b06575..219f03e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -105,7 +105,7 @@ ynh_exec_warn_less yunohost firewall allow TCP $rtmp_port ynh_script_progression --message="Reinstalling dependencies..." # Install nodejs -ynh_install_nodejs --nodejs_version=$YNH_NODEJS_VERSION +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION # Install dependencies ynh_install_app_dependencies $pkg_dependencies diff --git a/scripts/upgrade b/scripts/upgrade index d2a7031..73bb2d3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -107,8 +107,8 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - # Restore it if the upgrade fails ynh_clean_check_starting + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -187,7 +187,7 @@ ynh_add_nginx_config "datadir" ynh_script_progression --message="Upgrading dependencies..." # Install nodejs -ynh_install_nodejs --nodejs_version=$YNH_NODEJS_VERSION +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION # Install dependencies ynh_install_app_dependencies $pkg_dependencies