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

assigning script stdout to a variable #7320

Open
Tracked by #7418
tirelibirefe opened this issue Nov 1, 2023 · 1 comment
Open
Tracked by #7418

assigning script stdout to a variable #7320

tirelibirefe opened this issue Nov 1, 2023 · 1 comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@tirelibirefe
Copy link

tirelibirefe commented Nov 1, 2023

Hello,
I've searched the documentation but there is no clear sample.

I've seen an use case here here. Also
there are some samples how to run scripts but maybe stdout usage in other steps wasn't mentioned intentionally. I am not sure Tekton supports usage of stdout of a step in another step. Maybe it is supported anyway but not documented.

There are many circumstances need to run script but when the stdout cannot be used in other steps, running script is totally useless.

Thanks & Regards

@tirelibirefe tirelibirefe added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 1, 2023
@vdemeester
Copy link
Member

vdemeester commented Nov 2, 2023

Hey @tirelibirefe, I wonder if what you are looking for is the following doc. In the current version, it requires enabling alpha API. It allows you to declare where the output (stdout and/or stderr) will be written in the Task's filesystem to be share with other steps.
But in general, today (without alpha enabled), it is possible to do this exactly the way you would do with a shell script, using tee for example (making sure set -o pipefail is set for bash).

my-script-or-command | tree > /workspace/output-for-my-script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants