Suppose you have two Jenkins and you want a project in your Jenkins to be triggered by the another Jenkins, go ahead and read this article. You might need this setup in situations like source code build is created by a Jenkins job and the deployment is done by another Jenkins, and you want the deployment job to be triggered once is the build is created. Your use-case might be different from this. However let’s see how you can trigger a Jenkins job from remote Jenkins.
Assume remote Jenkins as source Jenkins and other Jenkins as destination Jenkins.
Step 1: Install Parameterized Remote Trigger Plugin in source Jenkins.
Jenkins doesn’t have builtin functionality to do trigger a Jenkins job from remote Jenkins. But there is a Parameterized Remote Trigger Plugin which does this for us. Install Parameterized Remote Trigger Plugin in Source Jenkins – A by following this article.
Step 2: Configure Source Jenkins to trigger the job at Destination Jenkins.
Once you completed installing the plugin, go to Source Jenkins homepage and click on Manage Jenkins >> Configure System . Then scroll down to see Parameterized Remote Trigger Configuration section and fill it as shown below.
Here fill Remote Jenkins URL with Destinations Jenkins URL and if your destination Jenkins has authentication(must have), choose one Authentication method. I have chosen Credentials Authentication and selected credentials of Destination Jenkins which I already added by following this Jenkins documentation. .
Now just go to your source Jenkins job and Click Configure button.
Under Build Section, Add Trigger a remote parameterized job as a build step.
Then select the Destination Jenkins name that we just added, give the job name that you want to trigger at destination Jenkins(here it is test ) and parameters.
Once saved, trigger the source Jenkins job. If there are any errors you would find it in the Console output . Console output of my source Jenkins job looked like below.
Congratulations, you have setup your Jenkins job to be triggered from a remote Jenkins job! Thanks for the time taken to read my blog.
Subscribe to this blog so that you don’t miss out anything useful (Checkout Right Sidebar for the Subscription Form and Facebook follow button) . Please also put your thoughts as comments .