Jenkins Plugin Git Changelog Setup for Bugzilla
How to setup Jenkins Plugin Git Changelog and support custom issues.
- Select job > Configure
- At bottom, select Add post-build action > Git Changelog
- CHANGELOG.html
- Configure template here Context is documented here.
ToDo: This needs improvement. It is hard to distinguish grouping of gits commit hash and issues.
<h1> Git Changelog changelog </h1>
<p>
Field Scout Git Changelog
</p>
{{#tags}}
<h2> {{name}} </h2>
{{#issues}}
{{#hasIssue}}
{{#hasLink}}
<h2> {{name}} <a href="{{link}}">{{issue}}</a> {{title}} </h2>
{{/hasLink}}
{{^hasLink}}
<h2> {{name}} {{issue}} {{title}} </h2>
{{/hasLink}}
{{/hasIssue}}
{{^hasIssue}}
<h2> {{name}} </h2>
{{/hasIssue}}
{{#commits}}
<a href="https://subsite.visualstudio.com/DefaultCollection/_git/field-scout/commit/{{hashFull}}">{{hashFull}}</a> {{authorName}} <i>{{commitTime}}</i>
<p>
<h4>{{{messageTitle}}}</h4>
{{#messageBodyItems}}
<li> {{.}}</li>
{{/messageBodyItems}}
</p>
{{/commits}}
{{/issues}}
{{/tags}}
- This works but does not sort by most recent date first?
- Can sorting be controlled in template so everything is assorted by most recent date first??
How sorting works:
- It seems to work by sorting in ascending bug number order; 123, 124, 126
- Appends remaining commits with missing "Bug" prefix, sorted most recent date first.
Assuming:
- Git commit comments are in the format of "BUG 1234 - Fixed memory leak"
git commit -am 'BUG 1234 - Fixed memory leak
- Bugzilla server URL format to display Bug 1234
http://server/bugzilla/show_bug.cgi?id=1234
The template references parameters: name, link, issue, and title.
Example:
<h2> {{name}} <a href="{{link}}">{{issue}}</a> {{title}} </h2>
{{/hasLink}}
{{^hasLink}}
Note: First three fields seem to be required before input will be saved? Title can be blank.
- Name:
*
- Pattern:
Bug\s([0-9]+)(.*)
- Link:
http://server/bugzilla/show_bug.cgi?id=${PATTERN_GROUP_1}
- Title: