Commit Graph

16 Commits

Author SHA1 Message Date
R Tyler Croy eac957569c Upgrade dependencies 2021-05-23 11:50:50 -07:00
R Tyler Croy e3717a4cef Revert "Checking in an abandoned work in progress on task URI management"
This reverts commit 403de15964.
2021-01-31 15:02:00 -08:00
R Tyler Croy 403de15964 Checking in an abandoned work in progress on task URI management 2021-01-31 15:01:42 -08:00
R Tyler Croy 35e186f828 Explore syntax for built-in tasks. Implementation is still ... crap 2021-01-01 15:39:06 -08:00
R Tyler Croy c6d62687b4 Add Transport.file_exists to clean up the run method for builtin tasks 2021-01-01 15:03:14 -08:00
R Tyler Croy 50ab1a5b14 Restructuring the file tree to make it easier to start adding "native tasks"
Some number of tasks I will want to be "builtin" and need to know a little bit
more about the transport in order to make that work.

The traits, they are coming.

See #1
2021-01-01 14:32:51 -08:00
R Tyler Croy 6e0c76dd70 Add disconnect to the Transport trait to allow groups to be properly run
Since I refactored a Transport to allow for maintaining a connection, subsequent
commands were being run on the same target. This ensures that when a group is
being run, that the session is flushed between connections
2021-01-01 11:13:07 -08:00
R Tyler Croy 56683f2288 Rename the zap-cli package to allow for publishing to crates.io 2021-01-01 10:25:27 -08:00
R Tyler Croy a3accf213a Refactor the parser package into a "model" package which is more accurate
Most of its job is to contain the models for different data structures
2021-01-01 10:10:01 -08:00
R Tyler Croy 59d44d7e0f Tweak the readme a bit to include recent syntax changes 2020-12-31 14:40:08 -08:00
R Tyler Croy d765cc5703 Support invoking a task with a file-based script via an args file
Basically the first parameter to the invoked task-file will be an args-file of
JSON-encoded parameters and values.

    ./my-special-script ._zap_args
2020-12-31 14:20:07 -08:00
R Tyler Croy eda6f523a3 Major refactor to cleanly run tasks from files or inline
ExecutableTask needs to find a new home, and some other things still need to get
shuffled around. This commit does however copy a temp file over for execution
which seems to be the best possible scenario for safe execution

An example run:

❯ RUST_LOG=debug ./target/debug/zap task tasks/shell/bash.ztask -p "script=set -xe; pwd" -t zap-freebsd
Running task with: TaskOpts { task: "tasks/shell/bash.ztask", parameter: ["script=set -xe; pwd"], targets: "zap-freebsd" }
 INFO  zap > Task located, preparing to execute
 DEBUG handlebars::render > Rendering value: Path(Relative(([Named("script")], "script")))
 DEBUG handlebars::context > Accessing context value: AbsolutePath(["script"])
err: + pwd
/root
2020-12-31 13:48:07 -08:00
R Tyler Croy ff3f3c5263 Move away from environment variables and switch to rendering scripts as handlebars
This will make sure there's a better cross-platform approach for getting
parameters into these commands.
2020-12-31 09:20:22 -08:00
R Tyler Croy 7b9066d096 Implement the simple support for running a task
This includes an echo task for funsies
2020-12-30 21:11:35 -08:00
R Tyler Croy 904bf007ce Start working on the task definition parsing grammar, pretty easy. 2020-12-30 14:27:33 -08:00
R Tyler Croy b66d6824bc Play around with simple SSH commands 2020-12-28 22:12:45 -08:00