From 9f8e5adbe2cb6bb64a4e804c37b69079a30186d6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 26 Aug 2021 07:54:43 +0200 Subject: [PATCH] Fix --- conf/systemd.service | 2 +- scripts/install | 10 ++++++++-- scripts/upgrade | 13 +++++++++---- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 9f40fd9..79f170c 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -9,7 +9,7 @@ Group=__APP__ WorkingDirectory=__FINALPATH__/ Environment="NODE_ENV=production" #Environment="__YNH_NODE_LOAD_PATH__" -ExecStart=__YNH_NODE__ __FINALPATH__/server/bin/prod.js +ExecStart=__FINALPATH__/server/bin/prod.js Restart=always # Sandboxing options to harden security diff --git a/scripts/install b/scripts/install index d791c7b..481c670 100644 --- a/scripts/install +++ b/scripts/install @@ -125,10 +125,16 @@ chown $app "$final_path/server/config.js" #============================================== ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=20 +#pushd "$final_path" +# ynh_use_nodejs +# ynh_exec_warn_less ynh_npm install +# ynh_exec_warn_less ynh_npm run build +#popd + pushd "$final_path" ynh_use_nodejs - ynh_exec_warn_less ynh_npm install - ynh_exec_warn_less ynh_npm run build + ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install + ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm run build popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index bcf15ec..977ed44 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -118,11 +118,16 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=16 + #pushd "$final_path" + # ynh_use_nodejs + # ynh_exec_warn_less ynh_npm install + # ynh_exec_warn_less ynh_npm run build + #popd pushd "$final_path" - ynh_use_nodejs - ynh_exec_warn_less ynh_npm install - ynh_exec_warn_less ynh_npm run build - popd + ynh_use_nodejs + ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install + ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm run build +popd fi #=================================================