Crates.io | engage |
lib.rs | engage |
version | 0.2.0 |
source | src |
created_at | 2022-09-18 06:13:40.67716 |
updated_at | 2023-09-20 03:36:26.325543 |
description | A task runner with DAG-based parallelism |
homepage | https://or.computer.surgery/charles/engage |
repository | https://or.computer.surgery/charles/engage |
max_upload_size | |
id | 668504 |
size | 150,590 |
engage
A task runner with DAG-based parallelism
sh
)A simple Engage file might look like this:
interpreter = ["bash", "-euo", "pipefail", "-c"]
[[task]]
name = "cargo"
group = "versions"
script = "cargo --version"
# There's no side effect that the following tasks depend on caused by the
# previous task, but this is just an example, and you wouldn't do this for real.
[[task]]
name = "cargo fmt"
group = "versions"
script = "cargo fmt --version"
depends = ["cargo"]
[[task]]
name = "cargo clippy"
group = "versions"
script = "cargo clippy --version"
depends = ["cargo"]
This creates a group called "versions"1 with three tasks: "cargo fmt"
and "cargo clippy", which depend on "cargo". This can be visualized by running
engage dot
and feeding the output to Graphviz:
When it's time to run a task, its script will be appended as a single element to
the interpreter
list, which will then be executed.
When run with no arguments, Engage will execute the entire DAG, starting by entering the "versions" group, running the "cargo" task's script first, then the other two tasks' scripts in parallel, and finally exiting the group.
This implicit parallelism with explicit ordering when required allows Engage to run your tasks as fast as possible, speeding up your workflows.
All task scripts are executed with the working directory set to the location of the Engage file.
Operations that require the Engage file can be invoked from the directory it's in or any of that directory's children.
Group and task dependencies must form a directed acyclic graph. In other words, dependency cycles are not allowed.
If a task fails, any dependent tasks will not be executed and Engage will exit
with a status of 1
.
If some other error occurs (e.g. configuration error), Engage will exit with a
status of 2
.
If no subcommand is supplied, all groups and tasks will be scheduled and executed based on their dependencies.
engage help
to see the available commands and their descriptions.Nouns are preferred for group names to make the single-group invocation syntax grammatically correct. ↩