From 240ecb3333bec52948759d29d0368eb2afbc429c Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Fri, 17 Jun 2022 16:35:56 -0400 Subject: [PATCH] Add typical workflow to README Currently, it is easy to overlook the section mentioning running tasks via the web UI. By adding a typical workflow, and some section headings, we make this clearer. --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index d7459682..eb2d5a65 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,18 @@ For more information, please consult the [Rails guides on autoloading and reload ## Usage +The typical Maintenance Tasks workflow is as follows: + +1. [Generate a class describing the Task](#creating-a-task) and the work to be done. +2. Run the Task + - either by [using the included web UI](#running-a-task-from-the-web-ui), + - or by [using the command line](#running-a-task-from-the-command-line), + - or by [using Ruby](#running-a-task-from-ruby). +3. [Monitor the Task](#monitoring-your-tasks-status) + - either by using the included web UI, + - or by manually checking your task's run's status in your database. +4. Optionally, delete the Task code if you no longer need it. + ### Creating a Task A generator is provided to create tasks. Generate a new task by running: @@ -500,8 +512,12 @@ end ### Running a Task +#### Running a Task from the Web UI + You can run your new Task by accessing the Web UI and clicking on "Run". +#### Running a Task from the command line + Alternatively, you can run your Task in the command line: ```sh-session @@ -528,6 +544,8 @@ bundle exec maintenance_tasks perform Maintenance::ParamsTask \ --arguments post_ids:1,2,3 content:"Hello, World!" ``` +#### Running a Task from Ruby + You can also run a Task in Ruby by sending `run` with a Task name to Runner: ```ruby