0

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?

erakitin
  • 11,437
  • 5
  • 44
  • 49
manohar_b
  • 23
  • 7

1 Answers1

0

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.

Slav
  • 27,057
  • 11
  • 80
  • 104
  • In a multi configuration project, the folder structure will be created with the axis name. and this name will be in the form of tokens. for example if I create an axis with name=MyAxis and value=axisX then the folder structure of the workspace would be something like ...\.jenkins\workspace\$MyAxis\axisX\ and this is where the workspace will be for a multi configuration job. and whenever one accesses the folder location, the token $MyAxis will be taken and this is what is expanding when i pass it to another job. – manohar_b Aug 27 '14 at 13:53