Custom Folder Icons for Jenkins

I was looking around for a Jenkins Plugin that would allow me to customize the icon of a Folder as we use folders to separate projects at work. To my annoyance i only found a plugin that requires using Cloudbees own hosted Jenkins solution (Jenkins Folder Plugin Plus). The plugin Custom Job Icon Plugin does closely what i want to achieve but only works for plain jobs and ignores folders for some reason.

For a moment i even considered writing my own Jenkins plugin to remedy this, but i ended up utilizing the userContent-folder and the Simple Theme Plugin that allows you to also execute custom javascript. This works because the files in the $JENKINS_HOME/userContent folder is reachable from http://JENKINS_URL/userContent. jQuery is also included in the frontend of Jenkins so i was able to utilize that to check for existing icons in /userContent/job-FOLDER_NAME.png with a HEAD ajax request.

So if you, like me, have been scouring the web for a simple solution to pimp your Jenkins folders then put the below JavaScript in /userContent and refer to it from the simple-theme plugin in the system configuration of Jenkins.

Here is the script:




No Comments


You can leave the first : )



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.