Html in Jenkins job descriptions
To embed HTML in Jenkins job descriptions, look no further than the Safe HTML plugin. Here's how to get it working:
- Navigate to Manage Jenkins > Configure Global Security.
- Set the Markup Formatter option to Safe HTML.
Take a look at this example:
Keep in mind, only a subset of HTML tags is permissible, in the interest of security.
Plugins and Configuration
Let's break down your journey to richer job descriptions in Jenkins:
Deploying Safe HTML via GUI
If you're in a hurry and need a quick fix:
- Go to Manage Jenkins > Configure Global Security.
- Find the Markup Formatter option and toggle it to
Safe HTML
to let your HTML shine through.
Going programmable with JASC Plugin
For those preferring the programmer zest of Configuration as Code, consider the CASC plugin:
- Insert
markupFormatter: safeHtml
in your config file. - Apply your configurations, and you've got HTML-supportive job descriptions!
CASC is a lifesaver when it comes to simultaneous Jenkins setups - it makes your configuration versionable and testable.
Staying updated
Jenkins has a penchant for updates, so keep an eye on the release notes. Always triple-check to make sure your settings are compatible with your current Jenkins version.
Mastering the Tips & Traps
Employing HTML in Jenkins job descriptions may come with quirks, but no worries. We've got your back:
Syntax Highlighting
If you're going HTML, double-check whether disableSyntaxHighLighting
is set to false in your Jenkins setup. Trust me, it makes your HTML more readable.
Navigation via Links
Use those inbuilt links Jenkins offers while setting up the security configurations. They're not there for fun - they guide you right!
Ensuring Safe HTML
Before jumping in, ascertain your custom HTML doesn't comprise active content like JavaScript or spooky CSS. Don't let your Jenkins fall prey to security threats.
Was this article helpful?