From 46b5ac9f1872b2f1b52598ee2fab994af181f0f7 Mon Sep 17 00:00:00 2001 From: Michal Konečný Date: Nov 28 2022 15:58:44 +0000 Subject: Add migration guide for Jenkins This commit adds migration guide from the current Jenkins Openshift instance to new one. As a bonus it fixes a small typo in CI Guide. :-) Signed-off-by: Michal Konečný --- diff --git a/docs/ci.md b/docs/ci.md index afd1a33..3e76de2 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -34,7 +34,7 @@ You can just copy that command in your own terminal (be sure to have up2date oc ### Jenkins We provide a Jenkins template that can be provisioned for you automatically. It's using the jenkins image from openshift catalog but we modified it with some extra parameters : Deployed jenkins will be able to launch ephemeral pods as jenkins executor (nothing should run on the jenkins pod itself) -For that you need to configure your job to use the `cico-workspace` label, as that will be automatically trigger a pod deployment in openshift from a template (cico-worspace) +For that you need to configure your job to use the `cico-workspace` label, as that will be automatically trigger a pod deployment in openshift from a template (cico-workspace) That environment pod is using a centos 8-stream based container, that will automatically connect to jenkins as "agent" and also contains the following tools : * git @@ -191,3 +191,33 @@ Worth knowing that while you can push through ssh, there is no allowed shell for !!! warning We'll implement some rotation to clean-up used space on that machine on regular basis, so don't expect pushed files to remain available forever ! + +## Migration to new CI instance + +In case you want to migrate your old jenkins configuration to new CI instance follow this guide. + +1. Login to [old openshift instance](https://oauth-openshift.apps.ocp.ci.centos.org/) +2. Click at your username in upper right corner and select `Copy login command` +3. Use [oc](https://console-openshift-console.apps.ocp.ci.centos.org/command-line-tools) tool to login +4. Switch to correct project `oc project ` (you should already be on correct project, but it's better to check) +5. Copy the old configuration to your machine `oc rsync :/var/lib/jenkins/jobs ` + + !!! note + Usually you want to only migrate jobs, but if you need any other configuration file, just + do `oc rsh ` and look inside `/var/lib/jenkins` for all configuration files. + Just be aware that some of the files could contain IP or hostname that will no longer work + in new CI instance. + +6. Login to [new openshift instance](https://console-openshift-console.apps.ocp.cloud.ci.centos.org/) +7. Click at your username in upper right corner and select `Copy login command` +8. Use [oc](https://console-openshift-console.apps.ocp.ci.centos.org/command-line-tools) tool to login +9. Switch to correct project `oc project ` (you should already be on correct project, but it's better to check) +10. Copy the configuration files from your machine to openshift pod `oc rsync jobs :/var/lib/jenkins` +11. Login to new Jenkins instance (the URL should be `https://jenkins-.apps.ocp.cloud.ci.centos.org`) +12. In the `Manage Jenkins` page click on `Reload Configuration from Disk` + +Now you should have your old configuration available in new Jenkins instance. + +!!! warning + This migration doesn't migrate any credentials from the old Jenkins instance. Those needs to be + migrated manually, because those are not stored in `/var/lib/jenkins`.