Commit Graph

9 Commits

Author SHA1 Message Date
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 5003d5eeff Add some comments to all the existing defined ztasks 2021-01-01 10:08:17 -08:00
R Tyler Croy 46dbe64f5f Add a simple /bin/sh task 2020-12-31 22:43:07 -08:00
R Tyler Croy dc1c67cf28 Add some package install tasks 2020-12-31 15:25:50 -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 a7efcc6085 Switch ztasks to be file-based
Played around with using symbols, and figuring out the namespacing is going to
be too much of a pain in the ass
2020-12-31 09:30:04 -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 754fd428f8 Allow passing some configuration for user/password on SSH
With some real integration testing it looks like the "set an environment
variable" approach is not really going to work effectively.

I think the script {} will need to be treated like a template instead, since
different shells require different ways of setting env variables and it doesn't
appear that there's a good ssh2-based way to set these environment variables.
2020-12-30 22:46:29 -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