tkzwtks / jenkins-backup-script

archive jenkins setting and plugins

Home Page:http://sue445.hatenablog.com/entry/2013/12/08/005317

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jenkins backup script

Archive Jenkins settings and plugins

  • $JENKINS_HOME/*.xml
  • $JENKINS_HOME/plugins/*.jpi
  • $JENKINS_HOME/jobs//.xml

Usage

./jenkins-backup.sh /path/to/jenkins_home archive.tar.gz

# add timestamp suffix
./jenkins-backup.sh /path/to/jenkins_home backup_`date +"%Y%m%d%H%M%S"`.tar.gz

run with Jenkins Job

1. install Exclusive Execution Plugin

https://wiki.jenkins-ci.org/display/JENKINS/Exclusive+Execution+Plugin

2. New Job

img

3. Configure

Source Code Management > Repository URL

git@github.com:sue445/jenkins-backup-script.git

Recommended : specify Branch Specifier with latest release tag (ex. 0.0.3)

0.0.3

Build Triggers > Build periodically

img

Build Environment > Set exclusive Execution

img

Build > Execute shell

img

ex.

./jenkins-backup.sh $JENKINS_HOME /path/to/backup_`date +"%Y%m%d%H%M%S"`.tar.gz

Operability confirmed

  • Debian lenny
  • CentOS 6

Changelog

master

full changelog

0.0.3

full changelog

  • There are cases where the directory is not created

0.0.2

full changelog

  • remove archive file if exixts

0.0.1

  • first release

About

archive jenkins setting and plugins

http://sue445.hatenablog.com/entry/2013/12/08/005317