-
Notifications
You must be signed in to change notification settings - Fork 4
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
3f5b87f
commit 349a011
Showing
26 changed files
with
273 additions
and
37 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
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
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,30 @@ | ||
🔖 [Table of Contents](../../README.md) / [Concepts](../README.md) / [Tasks](README.md) | ||
|
||
# RemoteCmdTask | ||
|
||
```python | ||
from zrb import ( | ||
runner, CmdTask, RemoteCmdTask, RemoteConfig, PasswordInput | ||
) | ||
|
||
install_curl = RemoteCmdTask( | ||
name='install-curl', | ||
inputs=[ | ||
PasswordInput(name='passsword') | ||
], | ||
remote_configs=[ | ||
RemoteConfig( | ||
host='192.168.1.10, | ||
user='ubuntu, | ||
password='{{input.password}}' | ||
) | ||
], | ||
cmd=[ | ||
'sudo apt update', | ||
'sudo apt install curl --y' | ||
] | ||
) | ||
runner.register(install_curl) | ||
``` | ||
|
||
🔖 [Table of Contents](../../README.md) / [Concepts](../README.md) / [Tasks](README.md) |
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,53 @@ | ||
🔖 [Table of Contents](../../README.md) / [Concepts](../README.md) / [Tasks](README.md) | ||
|
||
# RSyncTask | ||
|
||
```python | ||
from zrb import ( | ||
runner, CmdTask, RSyncTask, RemoteConfig, PasswordInput, StrInput | ||
) | ||
|
||
upload = RSyncTask( | ||
name='upload', | ||
inputs=[ | ||
PasswordInput(name='passsword'), | ||
StrInput(name='src'), | ||
StrInput(name='dst'), | ||
], | ||
remote_configs=[ | ||
RemoteConfig( | ||
host='192.168.1.10, | ||
user='ubuntu, | ||
password='{{input.password}}' | ||
) | ||
], | ||
is_remote_src=False, | ||
is_remote_dst=True | ||
src='{{input.src}}', | ||
dst='{{input.dst}}', | ||
) | ||
runner.register(upload) | ||
|
||
download = RSyncTask( | ||
name='download', | ||
inputs=[ | ||
PasswordInput(name='passsword'), | ||
StrInput(name='src'), | ||
StrInput(name='dst'), | ||
], | ||
remote_configs=[ | ||
RemoteConfig( | ||
host='192.168.1.10, | ||
user='ubuntu, | ||
password='{{input.password}}' | ||
) | ||
], | ||
is_remote_src=True, | ||
is_remote_dst=False | ||
src='{{input.src}}', | ||
dst='{{input.dst}}', | ||
) | ||
runner.register(download) | ||
``` | ||
|
||
🔖 [Table of Contents](../../README.md) / [Concepts](../README.md) / [Tasks](README.md) |
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 was deleted.
Oops, something went wrong.
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,20 @@ | ||
🔖 [Table of Contents](../README.md) / [FAQ](README.md) | ||
|
||
# Do Zrb has a Scheduler? | ||
|
||
No. Zrb focus is to help you run complicated tasks in a single run. You will need third party alternatives to make your tasks run by schedule. | ||
|
||
# Why No Scheduler? | ||
|
||
Implementing a Scheduler seems to be easy at the first glance. | ||
|
||
However, there are a few reasons why we don't build our own internal scheduler: | ||
|
||
- There are a lot of battle-proven tools and strategy you can already use. | ||
- Maintaining internal scheduler might distract us from the main goal. | ||
|
||
# What Can I Do to Make a Scheduled Task? | ||
|
||
Don't worry, there are some [tricks](../tutorials/run-task-by-schedule.md) you can use. For example you can use infinite loop, Cronjob, or even orchestrator like Airflow. | ||
|
||
🔖 [Table of Contents](../README.md) / [FAQ](README.md) |
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,11 @@ | ||
🔖 [Table of Contents](../README.md) / [FAQ](README.md) | ||
|
||
# How to Get Data from Other Tasks? | ||
|
||
Tasks are usually be isolated from each other. | ||
|
||
But it some cases, sharing data among tasks can be quite handy. Zrb doesn't support this mechanism out of the box, but you can make use `_ZRB_EXECUTION_ID` to achieve what you want. | ||
|
||
See [this tutorial](../tutorials/getting-data-from-other-tasks.md) for more information. | ||
|
||
🔖 [Table of Contents](../README.md) / [FAQ](README.md) |
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
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,11 @@ | ||
🔖 [Table of Contents](../README.md) / [Oops, I Did It Again](README.md) | ||
|
||
# Using The Same Variable to Define Different Task | ||
|
||
```python | ||
from zrb import runner, CmdTask | ||
|
||
|
||
``` | ||
|
||
🔖 [Table of Contents](../README.md) / [Oops, I Did It Again](README.md) |
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
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
Oops, something went wrong.