This plugin sets the description for each build, based upon a RegEx test of the build log file.
To use the plug in, you must tick it in the Post Build Actions, in your job configuration page. Once ticked, you will notice that it asks for a RegEx. This RegEx is used to scan the build log file, line by line (multi lines are not supported), and it will take the first line that matches your RegEx. The description that is then set for that particular build, is by default taken from the first Capturing Group. You must specify at least one capturing group in your RegEx by putting the part you want to select between parentheses (if you specify more, these will be ignored).
You can thus use this to have your build script echo out some particular information such as the modifying authors from SCM, or the datestamp, or the published version number, or....
For example, if your build file contains the lines
Then in order to set the build description to My Application Version XYZ, you would set the RegEx to be:
A Maven release build would typically have a line like:
So the following regex would select the version:
People interested in this plugin might also find Build Name Setter Plugin useful, as it does similar thing for the display name, instead of description.
Using multiple capture groups
You can now use different groups captured by the RegEx (e.g. "foo \1 bar \2") by referencing them in the Description field. (If you leave the description field empty, the first match group will be used.)
Release 1.9 (Jun 13, 2014)
- Set description during build as a build step (JENKINS-23097)
- Updated maven pom to use repo.jenkins-ci.org repository
- Localization for ja
Release 1.8 (Mar 26, 2011)
- Handle regex matches even when the match group element is null.
Release 1.7 (Dec 31, 2010)
Release 1.6 (Dec 1, 2009)
- Bugfix (1.5 is only usable for matrix projects)
- Large parts are rewritten. Should be backwards compatible -- create an issue if not.
- You can now use groups captured by the regex in descriptions (e.g. "foo \1 bar \2"). Default is still to use the first group as description.
- Also works for matrix projects
- Added option "Use explicit description instead of regexp". Allows user to hard code the description instead of doing a regexp search of build log. Default is off.
- Fixes an issue where the RegEx could return only 1 item and cause and array out of bounds problem.
- Add ability to set the description for failed builds. On your job configuration page you will need to check the box for setting description upon build failure and if you wish to use a different RegEx then the main one you can enter it in the text box below.