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