Backup of jenkins.freebsd.org

Backing up Jenkins config files

Backup to local repository

  1. On Jenkins server, Create local git repository at /usr/local/jenkins-config
    git init --bare /usr/local/jenkins-config/
    chown -R jenkins:jenkins /usr/local/jenkins-config/
  2. Edit project description
    echo freebsd/jenkins-config > /usr/local/jenkins-config/description
  3. Create hook script
    cp /usr/local/share/git-core/contrib/hooks/post-receive-email /usr/local/jenkins-config/hooks/post-receive
  4. Add following section in /usr/local/jenkins-config/config:
    [hooks]
            mailinglist = jenkins-admin@FreeBSD.org
            envelopesender = jenkins-admin@FreeBSD.org
            emailprefix = "[freebsd/jenkins-config] "
            emailmaxlines = 1000
            showrev = "git show -C %s; echo"
  5. Install the SCM Sync Configuration Plugin

  6. Configure SCM Sync to backup to file:///usr/local/jenkins-config

  7. Set up SCM Sync logging as recommended on SCM Sync Troubleshooting page

Backup to github (use with caution, sensitive data might be also published)

  1. On Jenkins server, use ssh-keygen to create an SSH key under the jenkins user ID: ~jenkins/.ssh/id_rsa_github
  2. On Jenkins server, add to ~jenkins/.ssh/config
    Host github
        Hostname github.com
        User git
        IdentityFile /usr/local/jenkins/.ssh/id_rsa_github
  3. On github configuration page for freebsd/jenkins-config , add id_rsa_github.pub as a Deployment Key
  4. Install the SCM Sync Configuration Plugin

  5. Configure SCM Sync to backup to https://github.com/freebsd/jenkins-config

  6. Set up SCM Sync logging as recommended on SCM Sync Troubleshooting page

Backing up of Jenkins hosts

TBD

Jenkins/Backup (last edited 2019-08-16T18:18:36+0000 by LiWenHsu)