{jenkins-plugin-info:description-setter} |
This plugin sets the description for each build, based upon a RegEx test of the build log file. |
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
... [version] My Application Version XYZ ... |
Then in order to set the build description to My Application Version XYZ, you would set the RegEx to be:
\[version\] (.*) |
A Maven release build would typically have a line like:
... [INFO] Uploading project information for my.project.name 0.4.0 ... |
So the following regex would select the version:
.*\[INFO\] Uploading project information for [^\s]* ([^\s]*) |
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.
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.)