From 75b5ea6138aa01dfbaa730936904dd7aab883b07 Mon Sep 17 00:00:00 2001 From: sue445 Date: Wed, 8 Jul 2015 01:07:51 +0900 Subject: [PATCH 1/2] Support secrets dir --- jenkins-backup.sh | 3 ++- test/jenkins_home1/secrets/master.key | 1 + test/jenkins_home2/secrets/master.key | 1 + test/test_jenkins-backup.rb | 4 ++++ 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 test/jenkins_home1/secrets/master.key create mode 100644 test/jenkins_home2/secrets/master.key diff --git a/jenkins-backup.sh b/jenkins-backup.sh index 2eda504..b10d355 100755 --- a/jenkins-backup.sh +++ b/jenkins-backup.sh @@ -23,7 +23,7 @@ if [[ -f "$TMP_DIR/$TMP_TAR_NAME" ]]; then rm "$TMP_DIR/$TMP_TAR_NAME" fi rm -rf "$ARC_DIR" -mkdir -p "$ARC_DIR/"{plugins,jobs,users} +mkdir -p "$ARC_DIR/"{plugins,jobs,users,secrets} cp "$JENKINS_HOME/"*.xml "$ARC_DIR" cp "$JENKINS_HOME/plugins/"*.[hj]pi "$ARC_DIR/plugins" @@ -33,6 +33,7 @@ if [ $hpi_pinned_count -ne 0 -o $jpi_pinned_count -ne 0 ]; then cp "$JENKINS_HOME/plugins/"*.[hj]pi.pinned "$ARC_DIR/plugins" fi cp -R "$JENKINS_HOME/users/"* "$ARC_DIR/users" +cp -R "$JENKINS_HOME/secrets/"* "$ARC_DIR/secrets" cd "$JENKINS_HOME/jobs/" ls -1 | while read job_name diff --git a/test/jenkins_home1/secrets/master.key b/test/jenkins_home1/secrets/master.key new file mode 100644 index 0000000..49d6062 --- /dev/null +++ b/test/jenkins_home1/secrets/master.key @@ -0,0 +1 @@ +THIS IS SECRET diff --git a/test/jenkins_home2/secrets/master.key b/test/jenkins_home2/secrets/master.key new file mode 100644 index 0000000..49d6062 --- /dev/null +++ b/test/jenkins_home2/secrets/master.key @@ -0,0 +1 @@ +THIS IS SECRET diff --git a/test/test_jenkins-backup.rb b/test/test_jenkins-backup.rb index 791d5a3..7f0de6e 100644 --- a/test/test_jenkins-backup.rb +++ b/test/test_jenkins-backup.rb @@ -49,6 +49,8 @@ def list_tar_file(tar_file) jenkins-backup/plugins/ jenkins-backup/plugins/dummy.hpi jenkins-backup/plugins/dummy.jpi + jenkins-backup/secrets/ + jenkins-backup/secrets/master.key jenkins-backup/users/ jenkins-backup/users/sue445/ jenkins-backup/users/sue445/config.xml @@ -88,6 +90,8 @@ def list_tar_file(tar_file) jenkins-backup/plugins/dummy.hpi.pinned jenkins-backup/plugins/dummy.jpi jenkins-backup/plugins/dummy.jpi.pinned + jenkins-backup/secrets/ + jenkins-backup/secrets/master.key jenkins-backup/users/ jenkins-backup/users/sue445/ jenkins-backup/users/sue445/config.xml From d2e84e6104e5fd8e9d1dba6be86382d29eeb3c85 Mon Sep 17 00:00:00 2001 From: sue445 Date: Wed, 8 Jul 2015 01:14:53 +0900 Subject: [PATCH 2/2] Write changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24ec6be..f068a20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## master [full changelog](https://github.com/sue445/jenkins-backup-script/compare/0.0.9...master) +* Support `$JENKINS_HOME/secrets` dir + * https://github.com/sue445/jenkins-backup-script/pull/25 + ## 0.0.9 [full changelog](https://github.com/sue445/jenkins-backup-script/compare/0.0.8...0.0.9)