
I would like to use the environment variable in the artifact src property
<environmentvariables>
<variable name="UTC_PRJ_PATH">code\MyProject</variable>
</environmentvariables>
Below syntax is not working
<artifacts>
<test src="${UTC_PRJ_PATH}/result/test_results.xml" dest="test-reports" />
</artifacts>
Comment
Hi Jebastine
I think the ${...} syntax is for Parameters, Environment variables have a %variable% syntax, so it might be worth trying %UTC_PRJ_PATH%.
Ian
I tried it, it is not working. I would like to scripts in way that the artifacts location is dynamic. Any Idea?
Hi Jebastine,
Instead of using a Go Environment Variable, use a Go Parameter. Give that a go and let us know if that doesn't work.
Thanks.
--Mark
So then how do you make the parameter dynamic? If I use the GO_PIPELINE_NAME and GO_PIPELINE_COUNTER to generate the name for an artifact in stage1. It would look something like <GO_PIPELINE_NAME>-<GO_PIPELINE_COUNTER>.war. And then in stage2 I want to do a fetch artifact to grab this particular artifact. However, I can not determine how I could use a parameter to do this. I can't access the environment variable in <fetchartifact>. So how would I tell <fetchartifact> the dynamically generated name of this artifact? Is this even currently possible?
Thanks,
-russ
Hi Russell,
Answer to your first few queries:
Parameters are not really meant to be dynamic. They are a part of your configuration and can be used to customize/simplify the pipeline configuration.
GO_PIPELINE_NAME and GO_PIPELINE_COUNTER are environment variables and cannot be used as parameters.
" So how would I tell <fetchartifact> the dynamically generated name of this artifact? Is this even currently possible?"
No, this is not currently possible.
Just as a suggestion, when you define a fetchArtifact task to fetch artifact from PipelineA-StageA-JobA, then it will always pick it up from the the latest run of PipelineA-StageA-JobA. So you could fetch the whole folder which cotains your artifact too.