zoukankan      html  css  js  c++  java
  • Jenkins-job迁移

    摘自:http://www.cnblogs.com/topplay/p/3899330.html

    Jenkins迁移job

    说明:从一个Jenkins服务器A将现有job迁移到另外一个Jenkins服务器B。
    方法:You can copy or move build jobs between instances of projects simply enough by copying or moving the

    build job directories to the new Jenkins instance.


    具体步骤如下:
    1、首先确认Jenkins的job存放目录。
    以管理员账号登录Jenkins,点击“系统管理/系统设置”,确认jenkins工作目录。
    本例中Jenkins A的工作目录为/home/.jenkins,Jenkins B的工作目录为/root/.jenkins。
     
    2、接下来,迁移jobs目录。
    登录Jenkins A服务器,进入工作目录,压缩jobs目录,并复制到B:
    1. cd /home/.jenkins
    2. tar -czvf jobs.tar.gz jobs
    3. scp -f jobs.tar root@BIP:/root/.jenkins/
     
    3、接着,在B上解压jobs.tar到jobs目录,并重启Jenkins服务器B。注意:重启不是必须的。
    1)通过重启hudson来加载新迁移的job:
    1. cd /root/.jenkins
    2. tar -zxvf jobs.tar
    本例通过重启tomcat服务来重启Jenkins,其他通过jar运行Jenkins的重启进程即可。
    1. cd /opt/tomcat/tomcat7/bin/
    2. ./shutdown.sh
    3. ./startup.sh
    2)不需要重启:
    just go to the Manage Jenkins screen and click on Reload Configuration From
    Disk. This will load the new jobs and make them immediately visible on the Jenkins dashboard. 
     
     
    点击上述红框中的“读取设置”按钮后,显示如下信息:


    4、最后,验证B上是否已经加载了迁移进来的新job,同时需要对job进行配置。
    1)登录到Jenkins B后,发现A上的jobs已经正确迁移进来。如下:
     
    5、注意事项
    1)修改job的配置:
    由于之前job设置是在Jenkins A的某个节点上执行,所以如果想让它在Jenkins B的某个节点上执行,则需要检查job的配置“Restrict where this project can be run”,设置job运行的节点。

     
    2)插件:如果Jenkins A上安装了插件,而B没有,则迁移过来的任务可能也需要安装A上的插件。
    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 in
    the plugins directory, so you can simply copy everything from this directory to the corresponding
    directory in your new instance.  
     
  • 相关阅读:
    pdf2html 的docker使用方法和细节
    CSS 各种特效,让设计高大上
    阳光沙滩的ps图片应该包含的元素
    flex布局好好研究把,总是记不住,记性差了,为什么
    proxy研究,不要照本宣科,我们来点有研究精神的文章
    彻底弄懂vue的scoped和deep的作用-----这两个关键词主要处理CSS相关的东西
    JS从数组中,随机抽取6个不重复的元素
    关于nginx隐藏index.php入口文件注意事项
    TP开发项目时遇到的问题记录
    TP3.2.x判断手机端访问,同一个域名在PC和手机端展示不同模板(半独立式网站)
  • 原文地址:https://www.cnblogs.com/workingdiary/p/6956955.html
Copyright © 2011-2022 走看看