1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/trilium_ynh.git synced 2024-10-01 13:34:49 +02:00

Use Node.JS 12

This commit is contained in:
Jules Bertholet 2021-04-25 18:16:05 -04:00
parent 25f03148c5
commit 04a98b6ec2
5 changed files with 7 additions and 9 deletions

View file

@ -7,9 +7,9 @@ Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
Environment=TRILIUM_DATA_DIR=/home/yunohost.app/__APP__ Environment=TRILIUM_DATA_DIR=/home/yunohost.app/__APP__
Environment="NODE_ENV=production" Environment=NODE_ENV=production
WorkingDirectory=__FINALPATH__/ WorkingDirectory=__FINALPATH__/
ExecStart=__YNH_NODE__ __FINALPATH__/src/www ExecStart=/usr/bin/env bash -c "PATH=__NODEJS_PATH__:$PATH node __FINALPATH__/src/www"
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -12,9 +12,9 @@ pkg_dependencies="nodejs npm libpng16-16 libpng-dev pkg-config autoconf libtool
#================================================= #=================================================
function set_node_vars { function set_node_vars {
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=10 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=12
ynh_use_nodejs ynh_use_nodejs
node_PATH=$nodejs_path:$(sudo -u $app sh -c 'echo $PATH') node_path=$nodejs_path:$(sudo -u $app sh -c 'echo $PATH')
} }
function build_node_app { function build_node_app {
@ -22,7 +22,7 @@ function build_node_app {
pushd $final_path || ynh_die pushd $final_path || ynh_die
chown -R $app:$app $final_path chown -R $app:$app $final_path
sudo -u $app touch $final_path/.yarnrc sudo -u $app touch $final_path/.yarnrc
sudo -u $app "env PATH=$node_PATH" yarn --cache-folder $final_path/yarn-cache --use-yarnrc $final_path/.yarnrc install 2>&1 sudo -u $app "env PATH=$node_path" yarn --cache-folder $final_path/yarn-cache --use-yarnrc $final_path/.yarnrc install 2>&1
chown -R root:root $final_path chown -R root:root $final_path
popd || ynh_die popd || ynh_die
} }

View file

@ -114,7 +114,7 @@ build_node_app
ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_script_progression --message="Configuring a systemd service..." --weight=1
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config -v ynh_node ynh_add_systemd_config -v nodejs_path
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION

View file

@ -92,8 +92,6 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=40
ynh_install_app_dependencies $pkg_dependencies 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" ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=10
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================

View file

@ -106,7 +106,7 @@ build_node_app
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config -v ynh_node ynh_add_systemd_config -v nodejs_path
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE