Receiving clean build information from CI server is very important to me, it is learning from http://travis-ci.org , so I want to have this in jenkins server as well since it is just html format.
How it works
You need to install “email-ext” plugin https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin for your jenkins first, and follow the guideline to configure the basic setup first.
Now this plugin sopport html template using jelly/js/groovy, jelly looks complex to me, so I decided to choose groovy (http://groovy.codehaus.org/), which is an agile and dynamic language for the JVM.
In order to use groovy customized html template, we need do extra
Create template directory
The template directory doesn’t exist, need to be created first, you can copy the template file from github directly
$ mkdir $JENKINS_HOME\email-templates # put the template inside
Enable groovy template inside project
Then in the jenkins, configure the post action in the job like below
Bugs in groovy
Unfortunately there are some bugs in the default template, and I provided one fix (issue #13191) there. Others needs more time to fix. Don’t worry, since we will redesign the html anyway, don’t need so care about the old one.
Anyway, you should receive html report in ugly format like below
Design my own html
Inspired by travis-ci’s report, I want to better html report from jenkins as well, below is my sketech for this.
- news: is used in header for general remindings
- status/main/detail: are all build information from job
- support: extra line for support information, like email, faq, etc ..
With the help from my friend @haojii, we got final html/css like below
I don’t want to go detail on the groovy, you just download the artifact: groovy-html-larry.template from my cloned email-ext repo@github and give a try.
It works for git, and skip some information in groovy standard template since it covers more cases, anyway it works for me and it is good enough.
DIY
You can tune with html file groovy-html-larry.html on your css and structure and apply to groovy template when it works
Summary
Better email report will help team to find their information quickly, and make it fun.
This is the first learning from travis-ci.org, and there are more ideas will be copied to jenkins.
Leave comments here if it works for you.
Everytime we talk about CI, we will have 2 steps in mind
It will be quite trickly if you want your software to be built and verified in different OS, mostly we need prepare the same machines, if you are good at jenkins, then master/slave mode is used.