diff --git a/conf/systemd.service b/conf/systemd.service index b6aadc5..752e578 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -ExecStart=__NODEJS_PATH__/npx next start -p __PORT__ +ExecStart=yarn run next start -p __PORT__ # Sandboxing options to harden security # Depending on specificities of your service/app, you may need to tweak these diff --git a/scripts/change_url b/scripts/change_url index e84da72..7f2b930 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -58,8 +58,7 @@ fi #================================================= ynh_script_progression --message="Rebuilding the app..." --weight=1 -ynh_use_nodejs -ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm run build --prefix="$install_dir" +ynh_exec_warn_less yarn --cwd "$install_dir" build #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 8057e68..80e15b5 100755 --- a/scripts/install +++ b/scripts/install @@ -61,11 +61,10 @@ echo "module.exports = { basePath: '$next_path', };" >> "$install_dir/next.confi #================================================= ynh_script_progression --message="Building the app..." --weight=1 -ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_use_nodejs -ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install --prefix="$install_dir" -npx next telemetry disable -ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm run build --prefix="$install_dir" +yarn config set enableTelemetry 0 +ynh_exec_warn_less yarn --cwd "$install_dir" install +yarn run next telemetry disable +ynh_exec_warn_less yarn --cwd "$install_dir" build #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index e22fd7d..e8a99d9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,9 +111,8 @@ chown $app:$app "$install_dir/.env.local" #================================================= ynh_script_progression --message="Rebuilding the app..." --weight=1 -ynh_use_nodejs -ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install --prefix="$install_dir" -ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm run build --prefix="$install_dir" +ynh_exec_warn_less yarn --cwd "$install_dir" install +ynh_exec_warn_less yarn --cwd "$install_dir" build #================================================= # START SYSTEMD SERVICE