Created
April 18, 2014 17:25
-
-
Save rpavlik/11055110 to your computer and use it in GitHub Desktop.
Script for migrating just the basics of a Jenkins install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SRCROOT=/media/da1ca593-583a-4f78-be0a-b0b628d726a4/var/lib/jenkins | |
DESTROOT=/var/lib/jenkins | |
SRCJOBS=${SRCROOT}/jobs | |
DESTJOBS=${DESTROOT}/jobs | |
for SRC in ${SRCJOBS}/*; do | |
if [ -d "${SRC}" -a -f "${SRC}/config.xml" ]; then | |
jobname=$(basename ${SRC}) | |
DEST="${DESTJOBS}/${jobname}" | |
[ -d "${DEST}" ] || mkdir -p "${DEST}" | |
[ -f "${DESTJOBS}/${jobname}/config.xml" ] || (echo Copying config ${jobname}; cp "${SRCJOBS}/${jobname}/config.xml" "${DESTJOBS}/${jobname}/config.xml") | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment