diff --git a/docs/index.rst b/docs/index.rst index 116b84b..4f6a4b3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,31 +1,32 @@ .. _swh-lister: Software Heritage - Listers =========================== Collection of listers for source code distribution places like development forges, FOSS distributions, package managers, etc. Each lister is in charge to enumerate the software origins (e.g., VCS, packages, etc.) available at a source code distribution place. Overview -------- .. toctree:: :maxdepth: 2 :titlesonly: tutorial run_a_new_lister + save_forge Reference Documentation ----------------------- .. toctree:: :maxdepth: 2 cli /apidoc/swh.lister diff --git a/docs/save_forge.rst b/docs/save_forge.rst new file mode 100644 index 0000000..8c4e5f6 --- /dev/null +++ b/docs/save_forge.rst @@ -0,0 +1,51 @@ +.. _save-forge: + +Save a forge +============ + +Assuming the forge's :ref:`listing type is already supported in the +scheduler`, use ``swh scheduler task add`` command: + +:: + + swh scheduler --config-file /etc/softwareheritage/scheduler.yml \ + task add [--policy [recurring|oneshot]] [param1=value1] [param2=value2] + +For example: + +- To add a task requiring no parameters (launchpad lister) + +:: + + $ swh scheduler --config-file /etc/softwareheritage/scheduler.yml \ + task add list-launchpad-full + INFO:swh.core.config:Loading config file /etc/softwareheritage/scheduler.yml + Created 1 tasks + + Task 1240540 + Next run: just now (2020-09-08 13:08:07+00:00) + Interval: 90 days, 0:00:00 + Type: list-launchpad-full + Policy: recurring + Args: + Keyword args: + +- To add a one-shot task with parameters: + +:: + + $ swh scheduler --config-file /etc/softwareheritage/scheduler.yml \ + task add --policy oneshot \ + list-gitea-full url=https://codeberg.org/api/v1/ limit=100 + INFO:swh.core.config:Loading config file /etc/softwareheritage/scheduler.yml + Created 1 tasks + + Task 1240540 + Next run: just now (2020-09-11 14:25:45+00:00) + Interval: 90 days, 0:00:00 + Type: list-gitea-full + Policy: oneshot + Args: + Keyword args: + limit: 100 + url: 'https://codeberg.org/api/v1/'