-
Notifications
You must be signed in to change notification settings - Fork 12
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 to pass data from build script to Task.Output.DockerImage.RegistryUpload
#289
Comments
Passing data that is generated during command execution to the upload steps is unfortunately not possible currently. I like the idea a lot, being able to pass data from the command step to the upload step would be very valuable. |
I want to implement this as its very handy to us. export STEP_VAR_V1=f00
export STEP_VAR_V2=f111 inside the config can do
wdyt? |
That would be great :-)
If I understand it right the idea is that the executed command sets environment variables, baur reads them, stores them and later templates the upload output config with it. Another way to pass data would be that the command writes the data to a file. The name of the file to that data must be written is defined by baur and could be made available as environment variable to the command. It also came to my mind that what you want to do could be realized in a different way. What do you think? |
This is a good idea. Example flow:
This is a good idea, and I think will be useful in general. A generic uploaded that is just a script execution and returns some output that is used as the artifact for the step. |
sounds great 👍, some comments:
Should be sufficient to only generate a unique filename. The file can be created by the executed command itself.
It should be easier for the first implementation to only support specifying the environment variable via the output file. Replacing the variables for the command is currently done after the config was parsed.
Are you sure that it is not possible to query via gotemplate statements nested |
Good points, simplify the implementation.
You are correct, gotemplate supports multilevel map[string]interface{} so that will also work. I will look at the code and see how hard its to implement something like this. |
Use case:
I have a build script that creates a docker image using docker build.
It decides the image tag/repo based on some parameters considered by the build script.
Build script:
The docker output is configured in the following way:
I need to somehow pass parameters into the
repository
andtag
values as they are not constant and generated by the build script.How can I do that? I tried setting env variables in the build script, but they are not passed down into the RegistryUpload step.
Thanks
The text was updated successfully, but these errors were encountered: