Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can a task pass a value to next task #29

Closed
MushiTheMoshi opened this issue Aug 4, 2022 · 4 comments
Closed

How can a task pass a value to next task #29

MushiTheMoshi opened this issue Aug 4, 2022 · 4 comments
Labels
question Further information is requested

Comments

@MushiTheMoshi
Copy link

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

@MushiTheMoshi MushiTheMoshi added the question Further information is requested label Aug 4, 2022
@alajmo
Copy link
Owner

alajmo commented Aug 6, 2022

Hi, currently it's not possible but it's on the TODO list #16

@itmecho
Copy link

itmecho commented Oct 8, 2022

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?

@alajmo
Copy link
Owner

alajmo commented Oct 9, 2022

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).

@MushiTheMoshi
Copy link
Author

thanks! that was my first guess I was thinking more for having conditional tasks, this is also working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants