amazon-web-servicesjenkinsamazon-ec2jenkins-pipelinejenkins-plugins

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.


Solution

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

    Setting up a Jenkins Server

    To add a Jenkins Server, you need to go to 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 which you will import the jobs.

    Jenkins Server Configuration

    If you don't have credentials, you'll need to add them to this server. To do this, click on the Add option below the URL settings.

    Adding Credentials

    Using the Jenkins Import Plugin

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

    If you added only one Jenkins Server, it will be selected by default. Otherwise, you'll need to select the correct Jenkins server:

    Selecting Jenkins Server

    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, click on the Query! button to start your import. A page with all jobs available for import will be shown.

    You'll 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 bit tedious. It's a good idea to select the Install required plugins option as well.

    Selecting Jobs to Import

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