I have a plan that generates a single artifact. It has some <random name>.bit
In another plan I import this artifact. I need to pass the name and full path of that artifact to a script. I see that you can include arguments when calling a script but I don't know the variable name for the artifacts. I read up on the bamboo variables and did not see any mention of artifacts.
I could use shell tricks to identify the artifact name and full path but I believe bamboo should have the exact details.
You are correct, there is no variable for that specifically. Even though that is the case, we can easily build paths with the following steps:
${bamboo.build.working.directory}/downloaded_artifacts/*
Does that solution work for your case?
Assuming you consider this should be a feature in Bamboo, please feel free to raise it to our development team through https://jira.atlassian.com/issues
I hope that helps.
When I download an artifact from other steps. It seems to come with the complete path where it was created in the previous project. In addition I am using wild card match to retrieve the artifact. This causes me to not know the complete file name.
some dir/some sub dir/output dir/some weird filename.bit
all I know is I got *.bit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got it! In this case, if the artifact path or filename does NOT have spaces I would use something like:
$(find ${bamboo.build.working.directory}/downloaded_artifacts/ -name *\.bit)
(i) This line could be used as an argument of your script.
If the artifact path or filename has spaces, I would use this to get them quoted:
find ${bamboo.build.working.directory}/downloaded_artifacts/ -name *\.bit > file
$(while read i; do echo \'$i\'; done < file)
(i) In this second example, the second line could be the argument of your script.
Let me know if that makes sense.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is essentially what I had to do. My paths do not have spaces. I only used it as an example for easy reading.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm glad you have this solved.
In case you want to open the feature request, please let me know if you need any help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.