1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jupyterlab_ynh.git synced 2024-09-03 19:26:35 +02:00

Merge pull request #6 from YunoHost-Apps/testing

Fix change url and upgrade scripts
This commit is contained in:
bourreP 2019-01-22 00:10:29 +01:00 committed by GitHub
commit 52b333ce4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 152 additions and 23 deletions

View file

@ -1,6 +1,6 @@
# JupyterLab for YunoHost
[![Integration level](https://dash.yunohost.org/integration/jupyterlab.svg)](https://ci-apps.yunohost.org/jenkins/job/jupyterlab%20%28Community%29/lastBuild/consoleFull)
[![Integration level](https://dash.yunohost.org/integration/jupyterlab.svg)](https://ci-apps.yunohost.org/jenkins/job/jupyterlab%20%28Community%29/lastBuild/consoleFull)
[![Install jupyterlab with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=jupyterlab)
> *This package allow you to install jupyterlab quickly and simply on a YunoHost server.
@ -36,9 +36,9 @@ Can the app be used by multiple users? **Yes**
#### Supported architectures
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/jenkins/job/jupyterlab%20(Community)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/jupyterlab%20(Community)/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/jenkins/job/jupyterlab%20(Community)%20(%7EARM%7E)/badge/icon)](https://ci-apps-arm.yunohost.org/jenkins/job/jupyterlab%20(Community)%20(%7EARM%7E)/)
* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/jenkins/job/jupyterlab%20(Community)/badge/icon)](https://ci-stretch.nohost.me/jenkins/job/jupyterlab%20(Community)/)
* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/jupyterlab%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/jupyterlab/)
* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/jupyterlab%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jupyterlab/)
* Jessie x86-64b - [![](https://ci-stretch.nohost.me/ci/logs/jupyterlab%20%28Community%29.svg)](https://ci-stretch.nohost.me/ci/apps/jupyterlab/)
## Links

View file

@ -4,7 +4,7 @@ After=syslog.target network.target
[Service]
Environment="PATH=__FINALPATH__/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
ExecStart=__FINALPATH__/bin/jupyterhub -f __CONFIGPATH__/jupyterhub_config.py 2&>> /var/log/__APP__.log
ExecStart=__FINALPATH__/bin/jupyterhub -f __CONFIGPATH__/jupyterhub_config.py
Restart=always
RestartSec=10
WorkingDirectory=__FINALPATH__

View file

@ -2,7 +2,7 @@
"name": "JupyterLab",
"id": "jupyterlab",
"packaging_format": 1,
"version": "0.35.4~ynh1",
"version": "0.35.4~ynh2",
"description": {
"en": "JupyterLab for Yunohost, an extensible environment for interactive and reproducible computing (notebook, terminal, text editor, file browser, rich outputs, etc.)",
"fr": "JupyterLab pour YunoHost, un environnement informatique extensible, interactif et reproductible (bloc-notes, terminal, éditeur de texte, explorateur de fichiers, texte enrichi, etc.)"

View file

@ -134,21 +134,26 @@ setup_source() {
if [ "$src_filename" = "" ] ; then
src_filename="${src_id}.${src_format}"
fi
local local_src="/opt/yunohost-apps-src/${YNH_APP_ID}/${src_filename}"
if test -e "$local_src"
then # Use the local source file if it is present
cp $local_src $src_filename
else # If not, download the source
local out=`wget -nv -O $src_filename $src_url 2>&1` || ynh_print_err $out
if ! test -e "$final_path"
then
local local_src="/opt/yunohost-apps-src/${YNH_APP_ID}/${src_filename}"
if test -e "$local_src"
then # Use the local source file if it is present
cp $local_src $src_filename
else # If not, download the source
local out=`wget -nv -O $src_filename $src_url 2>&1` || ynh_print_err $out
fi
# Check the control sum
echo "${src_sum} ${src_filename}" | ${src_sumprg} -c --status \
|| ynh_die "Corrupt source"
bash $src_filename -b -p $final_path
fi
# Check the control sum
echo "${src_sum} ${src_filename}" | ${src_sumprg} -c --status \
|| ynh_die "Corrupt source"
bash $src_filename -b -p $final_path
export "PATH=$final_path/bin/:$PATH"
if [ "$src_id" = "arm" ]

View file

@ -41,8 +41,6 @@ port_http_proxy=$(ynh_app_setting_get "$app" port_http_proxy)
# CHECK PATHS SYNTAX
#=================================================
test -n "$old_path" || old_path="/"
test -n "$new_path" || new_path="/"
new_path=$(ynh_normalize_url_path $new_path)
old_path=$(ynh_normalize_url_path $old_path)

View file

@ -36,7 +36,7 @@ ynh_systemd_action() {
# Following the starting of the app in its log
if [ "$log_path" == "systemd" ] ; then
# Read the systemd journal
journalctl -u $service_name -f --since=-45 > "$templog" &
journalctl -u $service_name -f -n0 > "$templog" &
else
# Read the specified log file
tail -F -n0 "$log_path" > "$templog" &

View file

@ -31,7 +31,6 @@ enable_terminal=$YNH_APP_ARG_ENABLE_TERMINAL
#=================================================
# Normalize the url path syntax
test -n "$path_url" || path_url="/"
path_url=$(ynh_normalize_url_path $path_url)
# This function check also the availability of this one

127
scripts/upgrade Normal file
View file

@ -0,0 +1,127 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# IMPORT GENERIC HELPERS
source /usr/share/yunohost/helpers
source ./experimental_helper.sh
# Load common variables and helpers
source ./_common.sh
#=================================================
# LOAD SETTINGS
#=================================================
app=$YNH_APP_INSTANCE_NAME
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
path_url=$(ynh_app_setting_get "$app" path_url)
admin=$(ynh_app_setting_get "$app" admin)
is_public=$(ynh_app_setting_get "$app" is_public)
port=$(ynh_app_setting_get "$app" port)
port_hub=$(ynh_app_setting_get "$app" port_hub)
port_http_proxy=$(ynh_app_setting_get "$app" port_http_proxy)
enable_terminal=$(ynh_app_setting_get "$app" enable_terminal)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
# TODO Add backup/restore scripts
## Backup the current version of the app
#ynh_backup_before_upgrade
#ynh_clean_setup () {
# # restore it if the upgrade fails
# ynh_restore_upgradebackup
#}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CHECK THE PATH
#=================================================
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path $path_url)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# NGINX CONFIGURATION
#=================================================
# Modify Nginx configuration file and copy it to Nginx conf directory
ynh_add_nginx_config
#=================================================
# CONFIGURE JUPYTERLAB
#=================================================
# Configure jupyterlab with jupyterhub_config.py file
config_jupyterlab
#=================================================
# DOWNLOAD, CHECK AND INSTALL JUPYTERLAB
#=================================================
setup_source $miniconda_architecture
#=================================================
# SPECIFIC SETUP
#=================================================
# ADD HUB EXTENSION
#=================================================
jupyter labextension install @jupyterlab/hub-extension
jupyter lab build
chown $admin -R $final_path/share/jupyter
#=================================================
# CONFIGURE JUPYTER NOTEBOOK
#=================================================
config_jupyter_notebook
#=================================================
# SETUP SYSTEMD
#=================================================
# Create a dedicated systemd config
add_systemd_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP SSOWAT
#=================================================
# If app is public, add url to SSOWat conf as skipped_uris
if [[ $is_public -eq 1 ]]; then
# See install script
ynh_app_setting_set "$app" unprotected_uris "/"
fi
#=================================================
# RELOAD NGINX
#=================================================
systemctl reload nginx
#=================================================
# ADVERTISE SERVICE IN ADMIN PANEL
#=================================================
yunohost service add $app --log "systemd"
#=================================================
# START SERVICE
#=================================================
ynh_systemd_action -n $app -a restart -l "JupyterHub is now running at" -p "systemd"