如何创建公共Jenkins更新站点的本地镜像?

时间:2013-11-21 17:40:15

标签: jenkins jenkins-plugins

我们在没有互联网访问权限的服务器上运行Jenkins(即使是通过代理)。 安装和保持Jenkins安装是最新的是一件痛苦的事!

我的想法是通过具有Internet访问权限的Windows工作站制作完整Jenkins公共更新站点的本地镜像。然后通过NFS共享将此本地镜像提供给Jenkins。

所以我的问题:如何制作本地镜像? 您是否有更好/更简单的想法来保持Jenkins安装的最新状态?

2 个答案:

答案 0 :(得分:3)

要生成更新站点(update-center.json),您可以使用https://github.com/jenkins-infra/backend-update-center2项目

我的步骤:

  1. 生成自签名证书
  2.     openssl genrsa -out your-update-center.key 1024
        openssl req -new -x509 -days 1095 -key your-update-center.key -out your-update-center.crt
    
    1. 将所有插件放入Nexus 2 maven存储库
    2. 克隆并构建backend-update-center2项目
    3. 生成update-center.json
    4. mvn exec:java -Dexec.args="-id default -h /dev/null 
          -o update-center.json -repository ULR_TO_NEXUS_REPO 
          -remoteIndex .index/nexus-maven-repository-index.gz -repositoryName YOUR_REPO_NAME 
          -directLink -pretty -nowiki -key your-update-center.key 
          -certificate your-update-center.crt 
          -root-certificate your-update-center.crt"
      
      1. 发布您的update-center.json。必须通过http / https
      2. 访问
      3. 将生成的your-update-center.crt复制到JENKINS_HOME / update-center-rootCAs文件夹
      4. “Jenkins→插件管理→高级→更新站点”定义发布的update-center.json的链接
      5. PS。不要忘记生成和发布Nexus 2 nexus-maven-repository-index.gz索引文件。使用“发布索引”任务。

        您可以在https://github.com/ikedam/backend-update-center2/wiki/How-to-create-your-own-Jenkins-Update-Center

        找到有关更新程序中心的一些其他信息

答案 1 :(得分:1)

手动下载war文件,停止服务器,更换war以及再次启动服务器的问题在哪里?插件也是如此。

如果我考虑一下,通过在可以访问互联网的系统上安装沙箱Jenkins,可能有更好的方法。您使用UI更新服务器,然后您可以彻底测试更新的Jenkins。完成后,您只需将war和hpi文件复制到“生产”Jenkins。现在你有一个很好的流程和QA。

相关问题