Last week, I have found myself tinkering with Jenkins again because of several reasons. I wanted to schedule the Cucumber–Watir functional checks I’ve written in the past two months so I don’t have to run them every time in the terminal. I also wanted to have a record of the results of the latest checks so I can look back at them when I need to. More importantly, I wanted a place where anyone from the team can view the said checks and see if our Staging environment is stable or not according to the smoke tests.
Of course, I also wanted this place to be somewhat nice-looking, which the default Jenkins page somewhat lacks.
And here are the tweaks I did to make the Jenkins user interface a little better:
- Use the Jenkins Material Theme to set the theme of Jenkins to look like Google’s material design. To do this:
- Download the Jenkins Simple Theme Plugin
- Install the downloaded plugin to Jenkins (Manage Jenkins -> Manage Plugins -> Advanced -> Upload plugin)
- Choose a desired color from their existing theme and complete the URL of the theme CSS, for example https://jenkins-contrib-themes.github.io/jenkins-material-theme/dist/material-teal.css. Replace the word teal with a color of your choice.
- Copy the URL
- Back in Jenkins, go to Manage Jenkins -> Configure System -> Theme
- Paste the URL that you copied as the value of URL of theme CSS
- Click Save
- Update jenkins.xml to support CSS when viewing HTML reports uploaded by post-build actions like the HTML Publisher Plugin, because Jenkins’ content security policy does not support it out of the box
- Go to the Jenkins installation directory, and look for the jenkins.xml file
- Open the file in a text editor
- Add the “-Dhudson.model.DirectoryBrowserSupport.CSP= “ command to the jenkins.xml arguments
- Save the file
- Allow HTML content in views and jobs descriptions. To do this:
- Go to Manage Jenkins -> Configure Global Security
- In the Markup Formatter field, select Raw HTML or Safe HTML
- Click Save
- Use the Ansicolor Plugin to properly display colors in the job’s console output. To do this:
- Download the Ansicolor Plugin
- Install the downloaded plugin to Jenkins (Manage Jenkins -> Manage Plugins -> Advanced -> Upload plugin)
- Configure the desired job’s Build Environment to use the Color ANSI Console Output






