Hi,
On Thu, 13 Apr 2017, at 15:41, 'Michael Hüttermann' via Jenkins Users
wrote:
> setting up a Jenkins 2 pipeline script, it will be stored with special
> chars in config.xml. Example:
> stage('Setup')
>
> Is it possible to force Jenkins to store the snippet as it was insert
> into the build job, in this example:
> stage('Setup')
Unlikely, as Jenkins is just doing plain old XML serialisation, and
`'` is the predefined XML entity for the apostrophe character.
You're not likely to get more control over how the XML is serialised.
At least for me, POSTing a config.xml without entities, and then
fetching it again does return the original XML that I POSTed, e.g.
`stage('First') { echo 'hey' }`.
If you need the XML without entities, just run it through your XML
processor of choice, for example:
$ curl -s
http://localhost:8080/job/test/config.xml | xmllint --format -
…
<script>stage('First') { echo 'hey' }</script>
…
Regards,
Chris