How can a task pass a value to next task
Hi there,
I am testing the tool, I like the simplicity very useful. Thank you.
I want to know if there is a way to store output from a task to use in the next task in the same recipe?
Hope you can help me.
Regards, Julio
Hi, currently it's not possible but it's on the TODO list https://github.com/alajmo/sake/issues/16
If it's a non-secret value, could you echo it to a /tmp file at the end of task 1 and then cat that file into a variable at the start of task 2?
Well it's possible to do something like this:
tasks:
pass-env:
tasks:
- cmd: echo hello > /tmp/some-env
- cmd: cat /tmp/some-env
$ sake run pass-env
Server | Output | Output
----------+--------+--------
server-1 | | hello
But it's not pretty and I'm looking into something more user-friendly. With this solution, you would need to clear the tmp file after each run manually (so as not to have a stale state).
thanks! that was my first guess I was thinking more for having conditional tasks, this is also working.