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.  
     
  • 相关阅读:
    用powershell启动appfabric报错
    对引用和指针使用以及函数返回引用和指针类型的理解
    数组指针和数组引用做参数的区别(是否能够限定数组大小、数组降价)
    C++静态成员函数基本概念讲解
    函数中变量的生存期和作用域
    如何在Source Insight中配置Pc Lint
    iterator与const_iterator
    周数据转换为天数据的一个Sql数据查询
    如何提高结构对象作为键的哈希表的查找速度
    尽量用iterator代替const_iterator
  • 原文地址:https://www.cnblogs.com/workingdiary/p/6956955.html
Copyright © 2011-2022 走看看