I tried search but didn't find any example. I tried https://jenkins.io/doc/pipeline/examples/#trigger-job-on-all-nodes and got it is for the different nodes on the same Jenkins. I would like to trigger a build on another Jenkins. I configured the Remote Hosts and Authentication in system configuration of my Jenkins. How to call "Parameterized Remote Trigger Plugin" in Jenkins Pipeline script?
2 Answers
6
votes
Seems to be an open bug: https://issues.jenkins-ci.org/browse/JENKINS-38657
As a workaround you could create another job locally of an old type and use the plugin in the old school non pipeline script way. Then in your pipeline script you would just trigger this job. I know it's an ugly adapter but then you have parametrize this adapter and have it up and running for almost anything ;)
EDIT:
The bug 38657 is already closed, the plugin is available as pipeline step since 16th of May 2018. Usage should be as easy as:
//Trigger remote job
def handle = triggerRemoteJob(remoteJenkinsName: 'remoteJenkins', job: 'RemoteJob')
More information on the triggerRemoteJob step