From ebba4c8b3557757ea5e5edbc3712db71e20b05fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 4 Jan 2023 19:41:06 +0100 Subject: [PATCH] Fix --- conf/systemd.service | 4 ++-- scripts/install | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 2b708ad..f59930b 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,9 +7,9 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ -Environment="__YNH_NODE_LOAD_PATH__" +Environment="PATH=__ENV_PATH__" Environment="NODE_ENV=production" -ExecStart=__YNH_NPM__ start +ExecStart=/usr/bin/yarn start TimeoutSec=60 Restart=always diff --git a/scripts/install b/scripts/install index 32c0531..6a87a6c 100755 --- a/scripts/install +++ b/scripts/install @@ -71,7 +71,9 @@ ynh_app_setting_set --app=$app --key=port --value=$port ynh_script_progression --message="Installing dependencies..." --weight=3 ynh_install_nodejs --nodejs_version=$NODEJS_VERSION + ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies + ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= @@ -132,8 +134,10 @@ ynh_script_progression --message="Building app..." --weight=15 pushd "$final_path" ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production yarn build - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run init + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn build + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn init + #ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production yarn build + #ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run init popd #================================================= @@ -141,6 +145,7 @@ popd #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 +env_path="$PATH" # Create a dedicated systemd config ynh_add_systemd_config