From ec743f45a4bf6e9f1f99b7cd577aeaec43a6cb24 Mon Sep 17 00:00:00 2001 From: oleole39 <59071673+oleole39@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:12:46 +0200 Subject: [PATCH] Add instructions to check locally whether autoupdate strategy is working --- src/utils/resources.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/utils/resources.py b/src/utils/resources.py index 4c8485f286..24bffe5441 100644 --- a/src/utils/resources.py +++ b/src/utils/resources.py @@ -420,6 +420,28 @@ class SourcesResource(AppResource): And the autoupdater will use the matched group (here: `4.1`) as the version. + You can make sure that your autoupdate strategy is working well immediately (without waiting for the next check on the infra) by doing the following: + 1. Clone this repo: https://github.com/YunoHost/apps_tools + 2. In `apps_tools` open a terminal to run the following commands: + ```sh + # Create test branch + git checkout -b localtest + + # Create a Python virtual environment + python -m venv venv + source venv/bin/activate + + # Install dependencies (if you don't have pip already installed on your system, check https://pip.pypa.io/en/stable/installation) + pip install -r requirements.txt + + # Run autoupdate script - replace '/path/to/myapp_ynh' with your actual local app path + ./autoupdate_app_sources/autoupdate_app_sources.py '/path/to/myapp_ynh' + ``` + 3. If the return output includes: + - `Apps udpated`, it ran successfully. Note that it will automatically make local changes in your app's `manifest.toml` (which can be discarded as they will be made automatically later online by the YNH infra); + - `Apps failed`, the autoupdate stragegy is not working properly - check the debug info; + - none of the above but `apps -> Autoupdater just ran, here are the results:`, it ran successfully but the app was already up to date. + ### Provision/Update - For elements with `prefetch = true`, will download the asset (for the appropriate architecture) and store them in `/var/cache/yunohost/download/$app/$source_id`, to be later picked up by `ynh_setup_source`. (NB: this only happens during install and upgrade, not restore)