How to create a local mirror of public Jenkins update site?

jenkins, jenkins-plugins

Solution

For generating update site (update-center.json) you can use https://github.com/jenkins-infra/backend-update-center2 project

My steps:

- Generate self signed certificate

    openssl genrsa -out your-update-center.key 1024
    openssl req -new -x509 -days 1095 -key your-update-center.key -out your-update-center.crt

- put all plugins into your Nexus 2 maven repository

- Clone and build backend-update-center2 project

- generate 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"

- publish your update-center.json. Has to be accessible via http/https

- copy generated your-update-center.crt to the JENKINS_HOME/update-center-rootCAs folder

- "Jenkins → Plugin manage → Advanced → Update site" define link to the published update-center.json

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.

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

Problem

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! 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. So my questions: How to make the local mirror? Do you have a better/simpler idea to keep the Jenkins installation up-to-date?

Original source