At times you encounter a use case where you need to run a Jenkins job remotely from another Jenkins instance. Well, there is a way to achieve this by using Parameterized Remote Trigger plugin.

Let’s see how we can trigger parameterized or non-parameterized jobs on remote Jenkins server from another Jenkins server.

Demonstration

Lets say we have two Jenkins server namely JenkinsOne and JenkinsTwo and we have a job name “TEST” on JenkinsTwo which we want to trigger from JenkinsOne.

To achieve the above stated task, we need to download Parameterized Remote Trigger Plugin on JenkinsOne. You can do that by clicking on Manage Jenkins option and then choosing Manage Plugins, wherein you can search and download the desired plugin.

Our JenkinsTwo server has password based access. So to trigger a job on it, first we need to log in to the server and then build the job. For this to happen from a remote server, we need to provide credentials to it. So before triggering a remote build on JenkinsOne, set the credentials by following the below mentioned steps.

Step 1:
Go to Manage Credentials option after choosing Manage Jenkins option on your console.

Step 2:
After that, choose add domain option. As our JenkinsTwo is a remote server so we need to specify its host name here.

Step 3:
After this specify the credentials so that we can log into JenkinsTwo. Since on the JenkinsTwo server we have password based authentication, we have to choose “Username with password” option as shown in the screenshot below.

Step 4:
Now go to Configure System option after selecting Manage Jenkins option.  Under Parameterized Remote Trigger Configuration, click on Add.

 

Step 5:
As soon as we click on Add, the Display name field will automatically show already added remote Jenkins server which is JenkinsTwo. After checking the “Use the credentials Plugin” option, we can see the already provided credentials. Now to access the server, we need to provide JenkinsTwo address and port number.

Step 5:
As soon as we click on Add, the Display name field will automatically show already added remote Jenkins server which is JenkinsTwo. After checking the “Use the credentials Plugin” option, we can see the already provided credentials. Now to access the server, we need to provide JenkinsTwo address and port number. - See more at: http://www.tothenew.com/blog/jenkins-parameterized-remote-trigger-plugin/#sthash.CRODs6PG.dpuf

 

Step 6:
Now make a new job in JenkinsOne. Here we are making this as a parameterized job, since our “TEST” job on JenkinsTwo is parameterized.

 

Step 7:
Now under the Build section, choose “Trigger a remotely parameterized job” option in the drop down menu of “Add build step” option as shown below.

Step 8:
After doing that, we can choose our remote Jenkins server in “Select a remote host” field

Step 9:
Type the name of the job which you want to build on remote jenkins server i.e. “TEST” job on JenkinsTwo server in our case. Specify the parameter i.e “NAME” required by the “TEST” job. Also, we need to use the value defined here in “name” parameter as shown below. Save your configuration changes.

Step 10:
The final step remaining is to Build the job.

 

Step 11:
After building the job, in the Console Output we can see that the job has been remotely built if all the configuration changes have been made correctly.

Step 12:
On our remote server  “JenkinsTwo”, if we can log in, we can verify that our job has been executed with the parameter’s value that was provided on JenkinsOne server and by the same user whose credentials we provided in the  initial steps.

 

[Original] http://www.tothenew.com/blog/jenkins-parameterized-remote-trigger-plugin/

Step 1:
Go to Manage Credentials option after choosing Manage Jenkins option on your console. - See more at: http://www.tothenew.com/blog/jenkins-parameterized-remote-trigger-plugin/#sthash.CRODs6PG.dpuf

At times you encounter a use case where you need to run a Jenkins job remotely from another Jenkins instance. Well, there is a way to achieve this by using Parameterized Remote Trigger plugin.

Let’s see how we can trigger parameterized or non-parameterized jobs on remote Jenkins server from another Jenkins server.

Demonstration

Lets say we have two Jenkins server namely JenkinsOne and JenkinsTwo and we have a job name “TEST” on JenkinsTwo which we want to trigger from JenkinsOne.

To achieve the above stated task, we need to download Parameterized Remote Trigger Plugin on JenkinsOne. You can do that by clicking on Manage Jenkins option and then choosing Manage Plugins, wherein you can search and download the desired plugin.

Our JenkinsTwo server has password based access. So to trigger a job on it, first we need to log in to the server and then build the job. For this to happen from a remote server, we need to provide credentials to it. So before triggering a remote build on JenkinsOne, set the credentials by following the below mentioned steps.

- See more at: http://www.tothenew.com/blog/jenkins-parameterized-remote-trigger-plugin/#sthash.CRODs6PG.dpuf

At times you encounter a use case where you need to run a Jenkins job remotely from another Jenkins instance. Well, there is a way to achieve this by using Parameterized Remote Trigger plugin.

Let’s see how we can trigger parameterized or non-parameterized jobs on remote Jenkins server from another Jenkins server.

Demonstration

Lets say we have two Jenkins server namely JenkinsOne and JenkinsTwo and we have a job name “TEST” on JenkinsTwo which we want to trigger from JenkinsOne.

To achieve the above stated task, we need to download Parameterized Remote Trigger Plugin on JenkinsOne. You can do that by clicking on Manage Jenkins option and then choosing Manage Plugins, wherein you can search and download the desired plugin.

Our JenkinsTwo server has password based access. So to trigger a job on it, first we need to log in to the server and then build the job. For this to happen from a remote server, we need to provide credentials to it. So before triggering a remote build on JenkinsOne, set the credentials by following the below mentioned steps.

- See more at: http://www.tothenew.com/blog/jenkins-parameterized-remote-trigger-plugin/#sthash.CRODs6PG.dpuf

At times you encounter a use case where you need to run a Jenkins job remotely from another Jenkins instance. Well, there is a way to achieve this by using Parameterized Remote Trigger plugin.

Let’s see how we can trigger parameterized or non-parameterized jobs on remote Jenkins server from another Jenkins server.

Demonstration

Lets say we have two Jenkins server namely JenkinsOne and JenkinsTwo and we have a job name “TEST” on JenkinsTwo which we want to trigger from JenkinsOne.

To achieve the above stated task, we need to download Parameterized Remote Trigger Plugin on JenkinsOne. You can do that by clicking on Manage Jenkins option and then choosing Manage Plugins, wherein you can search and download the desired plugin.

Our JenkinsTwo server has password based access. So to trigger a job on it, first we need to log in to the server and then build the job. For this to happen from a remote server, we need to provide credentials to it. So before triggering a remote build on JenkinsOne, set the credentials by following the below mentioned steps.

- See more at: http://www.tothenew.com/blog/jenkins-parameterized-remote-trigger-plugin/#sthash.CRODs6PG.dpuf
posted on 2016-08-26 16:22  漂浮的心  阅读(580)  评论(0编辑  收藏  举报