diff --git a/README.md b/README.md index a6e62fa..c791f26 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Archive Jenkins settings and plugins * `$JENKINS_HOME/*.xml` +* `$JENKINS_HOME/*.jks` * `$JENKINS_HOME/jobs/*/*.xml` * `$JENKINS_HOME/nodes/*` * `$JENKINS_HOME/plugins/*.jpi` diff --git a/jenkins-backup.sh b/jenkins-backup.sh index e42f193..295680d 100755 --- a/jenkins-backup.sh +++ b/jenkins-backup.sh @@ -64,6 +64,11 @@ function main() { cp "${JENKINS_HOME}/"*.xml "${ARC_DIR}" + jks_count=$(find ${JENKINS_HOME} -maxdepth 1 -type f -name *.jks | wc -l) + if [ ${jks_count} -ne 0 ]; then + cp "${JENKINS_HOME}/"*.jks "${ARC_DIR}/" + fi + cp "${JENKINS_HOME}/plugins/"*.[hj]pi "${ARC_DIR}/plugins" hpi_pinned_count=$(find ${JENKINS_HOME}/plugins/ -name *.hpi.pinned | wc -l) jpi_pinned_count=$(find ${JENKINS_HOME}/plugins/ -name *.jpi.pinned | wc -l) diff --git a/spec/jenkins-backup_spec.rb b/spec/jenkins-backup_spec.rb index 6dfa939..cf73109 100644 --- a/spec/jenkins-backup_spec.rb +++ b/spec/jenkins-backup_spec.rb @@ -25,6 +25,7 @@ "jenkins-backup/users/", "jenkins-backup/users/sue445/", "jenkins-backup/users/sue445/config.xml", + "jenkins-backup/saml-jenkins-keystore.jks", ] describe tar_file("/tmp/relative_archive.tar.gz") do diff --git a/spec/recipes/jenkins/default.rb b/spec/recipes/jenkins/default.rb index d936df5..9ae3ae3 100644 --- a/spec/recipes/jenkins/default.rb +++ b/spec/recipes/jenkins/default.rb @@ -18,6 +18,7 @@ %w( hudson.model.UpdateCenter.xml + saml-jenkins-keystore.jks ).each do |file| remote_file "#{node[:jenkins_home]}/#{file}" do mode "644" diff --git a/spec/recipes/jenkins/files/var/lib/jenkins/saml-jenkins-keystore.jks b/spec/recipes/jenkins/files/var/lib/jenkins/saml-jenkins-keystore.jks new file mode 100644 index 0000000..e69de29 diff --git a/spec/recipes/jenkins/saml-jenkins-keystore.jks b/spec/recipes/jenkins/saml-jenkins-keystore.jks new file mode 100644 index 0000000..e69de29