Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use job import plugin in jenkins

I don't have access to both servers so cli is not an option only jenkins ui is available. I need to import jobs using job import plugin but i am unable to figure how to configure the plugin so as to import jobs. Could anyone please help me with this.

like image 956
shrey tyagi Avatar asked Jun 30 '18 20:06

shrey tyagi


People also ask

How do I import jobs into Jenkins?

Step 1: Go to your Jenkins and click on the Manage Jenkins option. Step 2: Select Jenkins CLI option from the list of available options. Step 3: Download jenkins-cli. jar from the given arrow point.

How do I import jobs from one Jenkins to another?

You can: Move a job from one installation of Jenkins to another by simply copying the corresponding job directory. Make a copy of an existing job by making a clone of a job directory by a different name. Rename an existing job by renaming a directory.

How do I import XML into Jenkins?

Follow below steps Import and export jobs in jenkins Step 1- Open Jenkins and Go to the job which you want to export. Notes- We will use some commands which will help us to do our job. get-job- this will export the job in XML file. create-job – this will import the job from XML and will create job in Jenkins.


1 Answers

To configure the Jenkins Remote Plugin, you need to add a Jenkins Server to import your jobs.

Setting a Jenkins Server

To add a Jenkins Server, you need to go on your Jenkins configuration: Manage Jenkins > Configure System > Job Import Plugin or http://jenkins-host:port/configure and add the Url and credentials to the host from where will import the jobs.

enter image description here

If you don't have, will need to add the credentials to this server, to do this click on the option Add bellow the Url settings.

enter image description here

Using the Jenkins Import plugin

After setting a Jenkins server, you will be able to use the Jenkins Import plugin by going to option Job Import Plugin in the Jenkins home or going to the URL: http://jenkins-host:port/Job-import/ or http://jenkins-host:port/job-import/ in the new versions.

If you added only a Jenkins Server it will be selected as default, otherwise, the correct Jenkins server will need to be selected:

enter image description here

Normally you don't need to set the Remote folder or Search into folders options, so if you use the default Jenkins settings, leave these fields blank.

Then, you will click on the Query! button, to start your import. A page with all jobs available to be imported will be showed.

You will need to select all the jobs you want to import one by one, if you have many jobs (like in my case) this can be a little boring. A good idea is to select the Install required plugins option too.

enter image description here

After select everything, you can click on the Import! button to finally starts your import.

like image 87
valdeci Avatar answered Oct 03 '22 20:10

valdeci