0

I'm currently using a Jenkins build to run a bash command that activates a Python script. The build is parametrised, and i need to be able to set environment variables containing those parameters on the Windows slave to be used by the Python script.

So, my question is: How do i set temporary env. variables for the current build and secondly, how do i use Python to retreive them while running a script? An explanation of the process would be great since i couldn't make any solution work.

Shizzle
  • 961
  • 3
  • 10
  • 27
  • Does http://stackoverflow.com/questions/10625259/how-to-set-environment-variables-in-jenkins solve your problem ? – Pierre.Sassoulas Jul 22 '16 at 13:21
  • I've already reviewed this question, and the solution didn't work for me. I couldn't find the parameters on the slave. – Shizzle Jul 22 '16 at 13:24

1 Answers1

0

What I usually do is going on the build output, on the left you will find "Build environment Variables" or something similar and check if you can see them there, but the solution cited on the other SO post works usually for me as well

shipperizer
  • 1,641
  • 1
  • 13
  • 19
  • OK so what is the propsfile? How or where do i create it? – Shizzle Jul 22 '16 at 13:35
  • So there should be 5 fields, I don't actually recall the names right now as I m not able to reach it, anyway it should be the second from the top that goes under propagule obviously, there u type something like MYVAR=blah and you'll get it injected in the build, if u have multiple cars to inject just type them in a new line, the question mark next to the field will explain everything anyway – shipperizer Jul 22 '16 at 13:36