This repository has been archived by the owner on Jan 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54ea637
commit 0ed73f2
Showing
7 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
Pipelines | ||
========= | ||
|
||
Pipeline is a set of Tasks executing in selected order, with optional addition of error handling. | ||
|
||
|
||
@error | ||
------ | ||
|
||
Executes a Task or set of Tasks when error happens. Does not affect the final result. After error task is finished the whole execution is stopped, no any more task will execute. | ||
|
||
**Syntax:** | ||
|
||
.. tabs:: | ||
|
||
.. tab:: YAML | ||
|
||
.. code:: yaml | ||
version: org.riotkit.rkd/yaml/v2 | ||
pipelines: | ||
:upgrade: | ||
- task: ":db:backup" | ||
- task: ":db:stop" | ||
- block: | ||
error: [':notify', '--msg="Failed"'] | ||
tasks: | ||
- task: [':db:migrate'] | ||
- task: [":db:start"] | ||
- task: [":notify", '--msg', 'Finished'] | ||
.. tab:: Python | ||
|
||
.. code:: python | ||
from rkd.core.api.syntax import Pipeline, PipelineTask as Task, PipelineBlock as Block, TaskDeclaration | ||
from rkd.core.standardlib.core import DummyTask | ||
from rkd.core.standardlib.shell import ShellCommandTask | ||
# ... | ||
PIPELINES = [ | ||
Pipeline( | ||
name=':upgrade', | ||
description='Example', | ||
to_execute=[ | ||
Task(':db:backup'), | ||
Task(':db:stop'), | ||
Block(error=':notify --msg="Failed"', tasks=[ | ||
Task(':db:migrate') | ||
]), | ||
Task(':db:start'), | ||
Task(':notify', '--msg', 'Finished') | ||
] | ||
) | ||
] | ||
**Example workflow:** | ||
|
||
.. image:: rkd-pipeline-error.png | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters