Jenkins migration job

Source: Internet
Author: User
Note: migrate an existing job from Jenkins server a to another Jenkins server B. Method: You can copy or move build jobs between instances of projects simply enough by copying or moving thebuild job directories to the new Jenkins instance.
The procedure is as follows: 1. Check the directory where Jenkins jobs are stored.Log on to Jenkins as an administrator and click "System Management/system settings" to confirm the working directory of Jenkins. In this example, the working directory of Jenkins A is/home/. Jenkins, and the working directory of Jenkins B is/root/. Jenkins.
2. Next, migrate the jobs directory.Log on to the Jenkins a server, go to the working directory, compress the jobs directory, and copy it to B:
 
 
  1. cd /home/.jenkins
  2. tar -czvf jobs.tar.gz jobs
  3. scp -f jobs.tar [email protected]:/root/.jenkins/

3. Press jobs.tar to the jobs directory on B and restart Jenkins server B. Note: restarting is not required.1) Restart Hudson to load the new migration job:
 
 
  1. cd /root/.jenkins
  2. tar -zxvf jobs.tar
In this example, Jenkins is restarted by restarting the Tomcat service, and other restart processes that run Jenkins through jar can be restarted.
 
 
  1. cd /opt/tomcat/tomcat7/bin/
  2. ./shutdown.sh
  3. ./startup.sh
2) No need to restart: Just go to the manage Jenkins screen and click on reload configuration fromdisk. This will load the new jobs and make them immediately visible on the Jenkins dashboard.

Click the "read Settings" button in the above red box to display the following information:

4. Finally, verify whether the migrated new job has been loaded on B and configure the job.1) After logging on to Jenkins B, we found that jobs on a have been correctly migrated in. As follows:

5. Notes1) modify the job configuration: because the previous job configuration is executed on a node of Jenkins A, if you want to run it on a node of Jenkins B, check the job configuration "restrict where this project can be run" and set the node where the job runs.

2) Plug-In: If Jenkins A has installed the plug-in, but B does not, the migrated task may also need to install the plug-in on. There are a few gotchas, however. if you are migrating your jobs to a brand new Jenkins configuration, remember to install, or migrate, the Plugins from your original server. the plugins can be found inthe Plugins directory, so you can simply copy everything from this directory to the correspondingdirectory in your new instance.



From Weizhi note (wiz)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.