mirror of
https://github.com/YunoHost-Apps/jupyterlab_ynh.git
synced 2024-09-03 19:26:35 +02:00
75 lines
2.4 KiB
Bash
75 lines
2.4 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# INSTALL DEPENDENCIES
|
|
#=================================================
|
|
ynh_script_progression "Installing NodeJS..."
|
|
|
|
ynh_nodejs_install
|
|
|
|
ynh_hide_warnings npm install -g configurable-http-proxy
|
|
|
|
#=================================================
|
|
# SET ADMIN GROUP
|
|
#=================================================
|
|
ynh_script_progression "Adding $admin to $app's group..."
|
|
|
|
usermod -a -G "$app" "$admin"
|
|
|
|
#=================================================
|
|
# BUILD APP
|
|
#=================================================
|
|
ynh_script_progression "Building app..."
|
|
|
|
python3 -m venv "$install_dir/venv"
|
|
|
|
ynh_hide_warnings "$install_dir/venv/bin/python3" -m pip install \
|
|
jupyterlab=="$(jupyterlab_upstream_version)" \
|
|
jupyterhub \
|
|
jupyter_collaboration \
|
|
notebook \
|
|
jupyterhub-ldapauthenticator \
|
|
pyzmq \
|
|
jupyterlab-language-pack-fr-FR
|
|
|
|
#=================================================
|
|
# ADD A CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression "Adding $app's configuration file..."
|
|
|
|
mkdir -p "$install_dir/config"
|
|
|
|
path_no_slash=${path%/}
|
|
ynh_config_add --template="jupyterhub_config.py" --destination="$install_dir/config/jupyterhub_config.py"
|
|
ynh_config_add --template="jupyter_notebook_config.py" --destination="$install_dir/config/jupyter_notebook_config.py"
|
|
|
|
#=================================================
|
|
# SYSTEM CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression "Adding system configurations related to $app..."
|
|
|
|
ynh_config_add_nginx
|
|
|
|
ynh_config_add_systemd
|
|
yunohost service add "$app" --description="Console environment for running Python code" --log="/var/log/$app/$app.log"
|
|
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression "Starting $app's systemd service..."
|
|
|
|
# Start a systemd service
|
|
ynh_systemctl --service="$app" --action="start" --wait_until="JupyterHub is now running at" --log_path="systemd"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression "Installation of $app completed"
|