Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Jenkins Parameterized Remote Trigger Plugin" with File parameter to upload to the remote downsteream Jenkins job

Tags:

jenkins

Question:

Does anyone use or have experience with the "Jenkins Parameterized Remote Trigger Plugin" to run a Jenkins job remotely from another Jenkins instance and that job has a File parameter as one of the parameters?


Background:

In the build section of the upstream parent job, I choose "Triggered a remotely parameterized job" option in the drop down menu of "Add build step" option. That job has a text edit field for "Parameters" where I have the following

EMAIL=$email

AnyAppInstaller.ipa=${WORKSPACE}/AnyAppInstaller.ipa

where the first parameter is a "String" parameter and the 2nd parameter is a "File" parameter

In the downstream job executed remotely on a different Jenkins master, I do see the value of the "String" 1st parameter but for the "File" 2nd parameter of the .ipa, I don't see that file get transferred from the upstream job to the remotely downstream job.

What is the way for me to transfer that file from the upstream job to the remotely triggered downstream job?

I have used the "Jenkins Parameterized Trigger Plugin" to call a downstream job within the same Jenkins instance as the upstream job and it had the option to pass in the File parameter and transfer that file from the upstream job to the downstream job using the

"Add PametersFactories==>For every matching file, invoke a build"

Here is description of that option:

"Look for files that match the specified pattern in the current build, then for each of them trigger a build of the specified project(s) by passing that file as a file parameter. This implementation does not interpret the contents of those files, and instead it simply gets passed and placed into the workspace of the triggered project(s) under the name specified here. This is useful, for example, when you have a portion of the job that can be split into concurrently executable subtasks. In such a situation, you can have an earlier step produce subtask work units by packaging necessary stuff into individual files, then use this mode to execute them all in parallel"

It seems the "Jenkins Parameterized Remote Trigger Plugin" doesn't have that option.

Is it a limitation of the plugin?

like image 994
L.Vu Avatar asked Sep 30 '15 22:09

L.Vu


1 Answers

This is a limitation of Parameterized Remote Trigger Plugin. It passes parameters as string and doesn't create multipart HTTP request to handle file upload.

Instead, I'd suggest to try one of the following plugins:

  • https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+SSH+Plugin
  • https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+FTP+Plugin
  • https://wiki.jenkins-ci.org/display/JENKINS/Publish+over+Dropbox+Plugin
  • https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+CIFS+Plugin
  • https://wiki.jenkins-ci.org/display/JENKINS/Copy+To+Slave+Plugin (if remote is slave)
like image 191
Oleksandr Horobets Avatar answered Nov 11 '22 19:11

Oleksandr Horobets