Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

cafhach
Copy link

@cafhach cafhach commented Jan 11, 2021

"labels" directory is now backuped as well

Functional Account and others added 3 commits January 21, 2020 13:37
In the for-loop which creates the empty dirs in ARC_DIR, an entry for "labels" was missing.
bugfix: error if labels are present
@sue445 sue445 self-assigned this Jan 11, 2021
@@ -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"
Copy link
Owner

@sue445 sue445 Jan 11, 2021

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

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
Copy link
Owner

@sue445 sue445 Jan 11, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants