Reputation: 494
I'm migrating some Jenkins jobs to DSL code from the current manual configurations. Some of these jobs have descriptions which contain HTML, but I can't find a way to enter this HTML in the seed job so that the generated job contains the same description. In one example, the current job has this description:
Multi-Platform Build <br/><br/>
Builds nightly but only if there has been SCM revisions against the application Core Trunk. <br/><br/>
This is being replaced by <a href="http://myjenkinsserver/view/application/job/application-new">application-multi-platform-new</a>
Which results in a nicely formatted job description with line breaks and a hyperlink as well.
I want to replicate this when I generate the same job from a DSL script but there doesn't seem to be a way to do this.
Upvotes: 3
Views: 4967
Reputation: 954
It should be possible with just specifying the html-tags that you need. What is your output?
description("""
Multi-Platform Build <br/><br/>
Builds nightly but only if there has been SCM revisions against the application Core Trunk. <br/><br/>
This is being replaced by <a href="http://myjenkinsserver/view/application/job/application-new">application-multi-platform-new</a>
""")
Upvotes: 4
Reputation: 494
I've managed to find a workaround but I'd prefer to do this directly.
It's possible to use the below snippet:
job('multi-platform-build') {
description(readFileFromWorkspace('description.html'))
}
This allows you to have a separate file the workspace of the seed job which is called to provide the description.
This works but it's far from ideal as this means configuration being stored in two separate locations.
Upvotes: 0