mirror of
https://github.com/YunoHost-Apps/archivebox_ynh.git
synced 2024-09-03 18:15:54 +02:00
Install NodeJS and npm with the core helper
This commit is contained in:
parent
17071b44f0
commit
faf2d9da13
4 changed files with 20 additions and 9 deletions
|
@ -5,12 +5,14 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
pkg_dependencies="python3-venv expect nodejs npm \
|
pkg_dependencies="python3-venv expect \
|
||||||
apt-transport-https ca-certificates gnupg2 zlib1g-dev dumb-init gosu cron unzip curl \
|
apt-transport-https ca-certificates gnupg2 zlib1g-dev dumb-init gosu cron unzip curl \
|
||||||
fontconfig fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-symbola fonts-noto fonts-freefont-ttf \
|
fontconfig fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-symbola fonts-noto fonts-freefont-ttf \
|
||||||
wget curl chromium git ffmpeg youtube-dl ripgrep \
|
wget curl chromium git ffmpeg youtube-dl ripgrep \
|
||||||
build-essential python-dev python3-dev"
|
build-essential python-dev python3-dev"
|
||||||
|
|
||||||
|
nodejs_version=14
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -77,6 +77,8 @@ ynh_script_progression --message="Installing dependencies..." --weight=8
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -137,7 +139,7 @@ archivebox_cmd="$final_path/venv/bin/archivebox"
|
||||||
#=================================================
|
#=================================================
|
||||||
cp ../conf/package.json "$final_path/package.json"
|
cp ../conf/package.json "$final_path/package.json"
|
||||||
cp ../conf/package-lock.json "$final_path/package-lock.json"
|
cp ../conf/package-lock.json "$final_path/package-lock.json"
|
||||||
cd $final_path; npm ci
|
cd $final_path; ynh_npm ci
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DATA DIRECTORY
|
# CREATE DATA DIRECTORY
|
||||||
|
|
|
@ -92,6 +92,8 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1
|
||||||
# Define and install dependencies
|
# Define and install dependencies
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEMD
|
# RESTORE SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -75,6 +75,18 @@ ynh_script_progression --message="Making sure dedicated system user exists..." -
|
||||||
# Create a dedicated user (if not existing)
|
# Create a dedicated user (if not existing)
|
||||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# UPGRADE DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Upgrading dependencies..." --weight=1
|
||||||
|
|
||||||
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
|
if [ $nodejs_version != $(ynh_app_setting_get --app=$app --key=nodejs_version) ]; then
|
||||||
|
ynh_remove_nodejs
|
||||||
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE VIA PIP
|
# UPGRADE VIA PIP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -117,13 +129,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# UPGRADE DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading dependencies..." --weight=1
|
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE A CONFIG FILE
|
# UPDATE A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue