From b06d3494b1bf7587beecc6a096b79ae683ecde28 Mon Sep 17 00:00:00 2001 From: Julian Foad Date: Fri, 15 Nov 2024 11:22:55 +0000 Subject: [PATCH] deploy pre-built HTML: eliminate 'npm build' --- manifest.toml | 8 ++++---- scripts/install | 17 +---------------- scripts/upgrade | 20 +++----------------- 3 files changed, 8 insertions(+), 37 deletions(-) diff --git a/manifest.toml b/manifest.toml index d7abe34..0ceb772 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Scratch" description.en = "Programming language to create your own interactive stories, games, and animations" description.fr = "Langage de programmation pour créer vos propres histoires, jeux et animations interactifs" -version = "4.1.3~ynh1" +version = "4.1.3~jaf1" maintainers = [] @@ -45,9 +45,9 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://github.com/scratchfoundation/scratch-gui/archive/refs/tags/v4.1.3.tar.gz" - sha256 = "77283288fa9a8bbad9a02099d6bfc9180244d23ae7011e4c4b97953c509705ac" - autoupdate.strategy = "latest_github_tag" + url = "https://jo.trax.im/api/packages/julianfoad/generic/scratch-gui-dist/4.1.3/scratch-gui-dist-4.1.3.tar.gz" + sha256 = "54a520f30b204c7829f932c1413cbaff956f197411d14190cf721e527d7e854a" + #autoupdate.strategy = "..." [resources.system_user] diff --git a/scripts/install b/scripts/install index 5e93dee..ebb02dd 100644 --- a/scripts/install +++ b/scripts/install @@ -12,9 +12,6 @@ source /usr/share/yunohost/helpers #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing nodejs..." --weight=50 - -ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -22,7 +19,7 @@ ynh_install_nodejs --nodejs_version=$nodejs_version ynh_script_progression --message="Setting up source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir/sources" +ynh_setup_source --dest_dir="$install_dir/www" chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" @@ -30,18 +27,6 @@ chown -R "$app:www-data" "$install_dir" #================================================= # Build #================================================= -ynh_script_progression --message="Installing $app..." --weight=40 - -pushd "$install_dir/sources" - ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" "$ynh_npm" install - ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" BUILD_MODE=dist "$ynh_npm" run build -popd - -mv "$install_dir/sources/build" "$install_dir/www" -ynh_secure_remove --file="$install_dir/sources" - -chown -R "$app:www-data" "$install_dir" #================================================= # SYSTEM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 86ca9c2..de22006 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,5 +1,7 @@ #!/bin/bash +#================================================= +# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -10,9 +12,6 @@ source /usr/share/yunohost/helpers #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing nodejs..." - -ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -20,7 +19,7 @@ ynh_install_nodejs --nodejs_version=$nodejs_version ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir/sources" --full_replace=1 +ynh_setup_source --dest_dir="$install_dir/www" --full_replace=1 chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" @@ -28,19 +27,6 @@ chown -R "$app:www-data" "$install_dir" #================================================= # Build #================================================= -ynh_script_progression --message="Installing $app..." --weight=40 - -pushd "$install_dir/sources" - ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" "$ynh_npm" install - ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" BUILD_MODE=dist "$ynh_npm" run build -popd - -ynh_secure_remove --file="$install_dir/www" -mv "$install_dir/sources/build" "$install_dir/www" -ynh_secure_remove --file="$install_dir/sources" - -chown -R "$app:www-data" "$install_dir" #================================================= # REAPPLY SYSTEM CONFIGURATIONS