From 9e18e2790b2b31ae25670f5654fa24b3c3540b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 16 Jun 2024 10:36:27 +0200 Subject: [PATCH] cleaning --- manifest.toml | 8 ++++++++ scripts/install | 16 +++++++--------- scripts/upgrade | 14 +++++--------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/manifest.toml b/manifest.toml index a13a16a..1b11d01 100644 --- a/manifest.toml +++ b/manifest.toml @@ -38,6 +38,14 @@ ram.runtime = "50M" [resources] + [resources.sources] + + [resources.sources.main] + url = "https://github.com/jeremyckahn/chitchatter/archive/fcf9fcea52d1e09d689ed6998d729aa8d08be604.tar.gz" + sha256 = "02fe441716623ea1d9b9f4d06963d0e4e59501e7e671c5d97b9f4a137a110b3e" + autoupdate.upstream = "https://github.com/jeremyckahn/chitchatter" + autoupdate.strategy = "latest_github_commit" + [resources.system_user] [resources.install_dir] diff --git a/scripts/install b/scripts/install index dfd9369..8537746 100755 --- a/scripts/install +++ b/scripts/install @@ -21,17 +21,15 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= ynh_script_progression --message="Setting up source files..." --weight=4 -mkdir -p "$install_dir" -chown -R $app:www-data "$install_dir" +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Setting up source files..." --weight=1 -git config --system --add safe.directory $install_dir +# Download, check integrity, uncompress and patch the source from manifest.toml +ynh_setup_source --dest_dir="$install_dir" -# Download, check integrity, uncompress and patch the source from GitHub -git clone https://github.com/jeremyckahn/chitchatter "$install_dir" --quiet - -pushd "$install_dir" - git reset --hard --quiet $version_commit -popd +chown -R "$app:www-data" "$install_dir" #================================================= # NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 0da44f7..c659f2d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,16 +12,12 @@ source /usr/share/yunohost/helpers #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading source files..." --weight=5 +ynh_script_progression --message="Upgrading source files..." --weight=1 -pushd $install_dir - chown -R $app:www-data "$install_dir" - git config --system --add safe.directory $install_dir - - ynh_exec_as $app git fetch - ynh_exec_as $app git reset --hard --quiet $version_commit - ynh_exec_as $app git pull -popd +# Download, check integrity, uncompress and patch the source from manifest.toml +ynh_setup_source --dest_dir="$install_dir" + +chown -R "$app:www-data" "$install_dir" #================================================= # UPGRADE DEPENDENCIES