user7548672
user7548672

Reputation:

Jenkins - How to pass environmental variable from freestyle job to pipeline job

I have a freestyle job in Jenkins and would normally pass parameters to another freestyle job using the Predefined parameters option. example:

PROJECT=Myproject
PATH=/depot/workspace/

Previously I could access the above values through the KEY in the downstream job through the environment by using ${PROJECT} OR ${PATH}.

My problem now is that I have a pipeline job that needs to access the above values but when using ${PROJECT} OR ${PATH} it does not work.

So, in general how I want it to work is have the freestyle job run first and pass the parameters to the downstream pipeline job.

Upvotes: 2

Views: 1909

Answers (1)

Dibakar Aditya
Dibakar Aditya

Reputation: 4203

You might need to use "${params.PROJECT}" in your pipeline to access the parameters.

Upvotes: 2

Related Questions