Backup of jenkins.freebsd.org
Backing up Jenkins config files
Backup to local repository
- 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/
- Edit project description
echo freebsd/jenkins-config > /usr/local/jenkins-config/description
- Create hook script
cp /usr/local/share/git-core/contrib/hooks/post-receive-email /usr/local/jenkins-config/hooks/post-receive
- 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"
- Install the SCM Sync Configuration Plugin
- Configure SCM Sync to backup to file:///usr/local/jenkins-config
- Set up SCM Sync logging as recommended on SCM Sync Troubleshooting page
Backup to github (use with caution, sensitive data might be also published)
- On Jenkins server, use ssh-keygen to create an SSH key under the jenkins user ID: ~jenkins/.ssh/id_rsa_github
- On Jenkins server, add to ~jenkins/.ssh/config
Host github
Hostname github.com
User git
IdentityFile /usr/local/jenkins/.ssh/id_rsa_github
- On github configuration page for freebsd/jenkins-config , add id_rsa_github.pub as a Deployment Key
- Install the SCM Sync Configuration Plugin
- Configure SCM Sync to backup to https://github.com/freebsd/jenkins-config
- Set up SCM Sync logging as recommended on SCM Sync Troubleshooting page
Backing up of Jenkins hosts
TBD