Skip to content

Commit

Permalink
Document task object [ci skip]
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Co-authored-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
bentsherman and pditommaso committed Apr 9, 2022
1 parent 6e23e03 commit 1c83e21
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions docs/script.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,21 @@ Name Description
Process implicit variables
--------------------------

In the process definition scope it's available the ``task`` implicit variable which allow accessing
the current task configuration directives. For examples::
The following variables are implicitly defined in the ``task`` object of each process:

=============== ========================
Name Description
=============== ========================
``attempt`` The current task attempt
``hash`` The task unique hash Id
``index`` The task index (corresponds to ``task_id`` in the execution trace)
``name`` The current task name
``process`` The current process name
``workDir`` The task unique directory. NOTE: This is only available for processes that run native code via the ``exec:`` statement.
=============== ========================

The ``task`` object also contains the values of all process directives for the given task,
which allows you to access these settings at runtime. For examples::

process foo {
script:
Expand Down

0 comments on commit 1c83e21

Please sign in to comment.