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.
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.
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.
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.
To configure the Jenkins Remote Plugin, you need to add a Jenkins Server to import your jobs.
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.
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.
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:
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.
After select everything, you can click on the Import! button to finally starts your import.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With