-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add backup of labels directory #206
base: master
Are you sure you want to change the base?
Conversation
In the for-loop which creates the empty dirs in ARC_DIR, an entry for "labels" was missing.
bugfix: error if labels are present
@@ -83,6 +86,10 @@ function main() { | |||
cp -R "${JENKINS_HOME}/nodes/"* "${ARC_DIR}/nodes" | |||
fi | |||
|
|||
if [ "$(ls -A ${JENKINS_HOME}/labels/)" ] ; then | |||
cp -R "${JENKINS_HOME}/labels/"* "${ARC_DIR}/labels" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cafhach [MUST] Add a test case below to see if the labels directory is really archived
jenkins-backup-script/spec/jenkins-backup_spec.rb
Lines 1 to 27 in 85e4519
ARCHIVED_FILES = [ | |
"jenkins-backup/hudson.model.UpdateCenter.xml", | |
"jenkins-backup/jobs/", | |
"jenkins-backup/jobs/example_job/", | |
"jenkins-backup/jobs/example_job/config.xml", | |
"jenkins-backup/jobs/space contain job/", | |
"jenkins-backup/jobs/space contain job/config.xml", | |
"jenkins-backup/jobs/example_folder/", | |
"jenkins-backup/jobs/example_folder/config.xml", | |
"jenkins-backup/jobs/example_folder/jobs/example_job_in_folder/", | |
"jenkins-backup/jobs/example_folder/jobs/example_job_in_folder/config.xml", | |
"jenkins-backup/jobs/example_folder/jobs/space contain job in folder/", | |
"jenkins-backup/jobs/example_folder/jobs/space contain job in folder/config.xml", | |
"jenkins-backup/nodes/", | |
"jenkins-backup/nodes/slave/", | |
"jenkins-backup/nodes/slave/config.xml", | |
"jenkins-backup/plugins/", | |
"jenkins-backup/plugins/dummy.hpi", | |
"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", | |
] |
mkdir -p "${ARC_DIR}/${plugin}" | ||
done | ||
|
||
cp "${JENKINS_HOME}/"*.xml "${ARC_DIR}" | ||
|
||
cp "${JENKINS_HOME}/.owner" "${ARC_DIR}" | ||
ls "${JENKINS_HOME}/plugins" > ${ARC_DIR}/content_of_plugins_folder.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cafhach [QUESTION] Is this really necessary?
The subject of this PR is the addition of the labels
directory, But I don't think this is relevant
"labels" directory is now backuped as well