Setting a new property from Groovy Script to pass to the next job

61 views
Skip to first unread message

Mathew Joseph

unread,
Sep 1, 2016, 6:29:22 PM9/1/16
to Jenkins Users
Hi All,

   My job involves 2 build steps 

Step 1 : Groovy script to retrieve a list of files and populate a parameter or environment variable say TEST_FILES
Step 2 : VSTEST job that can read TEST_FILES and use that a parameter

I have obtained the list of files, but what are the options available for setting parameters 

I tried using
def pa = new ParametersAction([new StringParameterValue('TEST_FILE', dllFiles)]);  

and then try something like

// Add variable to current jobs environment variables.
Thread.currentThread().executable.addAction(pa) 
build.addAction(pa) 


But ParametersAction is not available for a script running on the Node.

Any ideas?

Thanks in advance,
Mathew

Ioannis Moutsatsos

unread,
Sep 1, 2016, 10:43:19 PM9/1/16
to Jenkins Users
I would write the parameters out to a properties file and have an EnvInject plugin step re-inject them as build properties before your Step 2 script uses them.
Reply all
Reply to author
Forward
0 new messages