#7 Add migration guide for Jenkins
Merged 2 years ago by arrfab. Opened 2 years ago by zlopez.
centos/ zlopez/sig-guide ci_migration  into  master

Add migration guide for Jenkins
Michal Konečný • 2 years ago  
file modified
+31 -1
@@ -34,7 +34,7 @@ 

  ### 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 @@ 

  

  !!! 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 <project_name>` (you should already be on correct project, but it's better to check)

+ 5. Copy the old configuration to your machine `oc rsync <pod_name>:/var/lib/jenkins/jobs <target_directory>`

+ 

+    !!! note

+        Usually you want to only migrate jobs, but if you need any other configuration file, just

+        do `oc rsh <pod_name>` 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 <project_name>` (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 <pod_name>:/var/lib/jenkins`

+ 11. Login to new Jenkins instance (the URL should be `https://jenkins-<project_name>.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`.

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ý mkonecny@redhat.com

LGTM and I know you tested on stg instance so let's merge it and eventually we'll be able to add other details if CI tenants will have questions

Pull-Request has been merged by arrfab

2 years ago
Metadata