如何创建公共Jenkins更新站点的本地镜像? [英] How to create a local mirror of public Jenkins update site?
问题描述
我们在没有Internet访问权限的服务器(甚至通过代理)上运行Jenkins. 安装并保持Jenkins安装最新是很痛苦的!
We are running Jenkins on a server that does not have internet access (even through proxy). Installing and keeping the Jenkins installation up-to-date is a pain!
我的想法是通过可访问Internet的Windows工作站对完整的Jenkins公共更新站点进行本地镜像.然后通过NFS共享将该本地镜像提供给Jenkins.
My idea was to make a local mirror of the complete Jenkins public update-site through a Windows workstation that has internet access. And then make this local mirror available to Jenkins through NFS share.
所以我的问题是:如何制作本地镜像? 您是否有更好/更简单的想法来使Jenkins安装保持最新?
So my questions: How to make the local mirror? Do you have a better/simpler idea to keep the Jenkins installation up-to-date?
推荐答案
要生成更新站点(update-center.json),可以使用
For generating update site (update-center.json) you can use https://github.com/jenkins-infra/backend-update-center2 project
我的步骤:
- 生成自签名证书
openssl genrsa -out your-update-center.key 1024
openssl req -new -x509 -days 1095 -key your-update-center.key -out your-update-center.crt
- 将所有插件放入Nexus 2 maven存储库
- 克隆并构建backend-update-center2项目
- 生成update-center.json
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"
- 发布您的update-center.json.必须通过http/https 进行访问
- 将生成的your-update-center.crt复制到JENKINS_HOME/update-center-rootCAs文件夹中
- "Jenkins→插件管理→高级→更新站点"定义了指向已发布的update-center.json的链接
PS.不要忘记生成和发布Nexus 2 nexus-maven-repository-index.gz索引文件.为此,请使用发布索引"任务.
PS. don't forget to generate and publish Nexus 2 nexus-maven-repository-index.gz index file. Use the "Publish the indexes" task for that.
有关Updater Center的一些其他信息,您可以在 https://github.com/ikedam/backend-update-center2/wiki/How-to-create-your-own-Jenkins-Update-Center
Some additional information about Updater Center you can find at https://github.com/ikedam/backend-update-center2/wiki/How-to-create-your-own-Jenkins-Update-Center
这篇关于如何创建公共Jenkins更新站点的本地镜像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!