In my Jenkins job, I have a situation where I am passing the absolute path of a file to next job as a parameter from property file. The path has a token as a folder name(result of multi configuration job). When I trigger the next job with this path, or use the key, the token's value is passed instead of the token itself. So, is there a way to override the token?
For example.,
say var=456
Property file content:
Param=c:\temp\${var}\fldr1\fldr2\hello.txt
When I pass this to the next job, the actual value of the token ${var}
is taken i.e.,
c:\temp\456\fldr1\fldr2\hello.txt
I want the token name to be as it is ${var}
.
How to override this feature? Or how to keep the token as it is in the path?
If the plugin expands variables (and seems like you are talking about Parameterized Trigger plugin), then short of modifying the source code of the plugin yourself, you can't really do anything.
Don't write the token to file with a syntax that makes Jenkins expand it. Write it as
[var]
or@var@
or something. Then, once your downstream job receives the value, you can parse as you need, or substitute to a value at that point.