Table of Contents

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/
  1. Edit project description
echo freebsd/jenkins-config > /usr/local/jenkins-config/description
  1. Create hook script
cp /usr/local/share/git-core/contrib/hooks/post-receive-email /usr/local/jenkins-config/hooks/post-receive
  1. 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"
  1. Configure SCM Sync to backup to file:///usr/local/jenkins-config
  2. 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
  1. On github configuration page for freebsd/jenkins-config , add id_rsa_github.pub as a Deployment Key
  2. Configure SCM Sync to backup to https://github.com/freebsd/jenkins-config
  3. Set up SCM Sync logging as recommended on SCM Sync Troubleshooting page

Backing up of Jenkins hosts

TBD