Closed u3r closed 8 years ago
Thanks for the contribution! I should have some time this week to merge it.
I've done some tests - you are right: jenkins really does not like pretty printed xml. The xml handling could be improved by some conditional formatting to get good templates:
XmlNodePrinter(preserveWhitespace:true)
should fix that - but I don't have patch ready right now.
I have added config options to preserve whitespace as mentioned above.
Defaults are false
for dumpJenkinsJobs (to preserve compatibility) and
true
for dumpRemoteJenkinsJobs (if enabled via prettyPrint = true
).
So one can easily configure a jenkins job, dump it with the command and use it as template without manual reformatting while still being more readable than the one-line xml.
I don't mind defaults changing - take your pick on what you like.
I've had good luck with the u3r:master branch. With prettyPrint = true and prettyPrintPreserveWhitespace = false, I was able to quickly capture the configuration for a Jenkins server by running the dumpRemoteJenkinsItems task, storing the XML files locally, and verify that these files are correct by running the validateJenkinsItems task.
Thanks for the contribution! This is in v1.3.2.
When pulling the initial configuration off of an exiting jenkins it is nice to have human readable xml.