프로젝트
GitHub에서 보기
sue445/jenkins-backup-script
소개
Jenkins 설정과 플러그인 보관
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- +2
- in 15 days
- +3
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalJenkins backup script
Archive Jenkins settings and plugins
$JENKINS_HOME/*.xml$JENKINS_HOME/*.jks$JENKINS_HOME/jobs/*/*.xml$JENKINS_HOME/nodes/*$JENKINS_HOME/plugins/*.jpi$JENKINS_HOME/secrets/*$JENKINS_HOME/users/*
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

3. Configure
Source Code Management > Repository URL
https://github.com/sue445/jenkins-backup-script.git
- Recommended : specify Branch Specifier with latest release tag
- Check https://github.com/sue445/jenkins-backup-script/releases

Build Triggers > Build periodically

Build Environment > Set exclusive Execution

Build > Execute shell

ex.
./jenkins-backup.sh $JENKINS_HOME /path/to/backup_`date +"%Y%m%d%H%M%S"`.tar.gz
Operability confirmed
- Debian wheezy
- Debian jessie
- Debian stretch
- Debian buster
- CentOS 6
- CentOS 7
Testing
requirements Docker
bundle install
bundle exec itamae docker --node-yaml=spec/node.yml spec/recipes/bootstrap.rb --image=centos:7 --tag local:latest
DOCKER_IMAGE=local:latest bundle exec rspec
Tips
rotate backup files
# keep backup with latest 30 days
find /path/to/backup_* -mtime +30 -delete
Restore commands
example
sudo /etc/init.d/jenkins stop
cd /path/to/backup_dir
tar xzvf backup.tar.gz
sudo cp -R jenkins-backup/* /path/to/jenkins/
sudo chown jenkins:jenkins -R /path/to/jenkins/
sudo /etc/init.d/jenkins start
Changelog
관련 프로젝트 살펴보기
불러오는 중…