This plugin executes a groovy script in the Jenkins JVM. Typically, the script checks some conditions and changes accordingly the build result, puts badges next to the build in the build history and/or displays information on the build summary page.
The groovy script can use the variable manager, which provides access to the following objects and methods:
It is also possible to delete badges and summaries by using the following links:
The script below puts a warning badge and mark the build as unstable if it detects that deprecated methods were used.
Suppose we have a parameterized build, which uses the boolean parameter storeToDB in order to instruct the build to store some artifacts into the database. The script below puts a badge next to the builds for which this parameter is set.
Suppose we have a parameterized build, which uses the string parameter version. The script below puts a short text indicating the value of this parameter next to successful and unstable builds.
The script below determines how long it took to build the project and displays the corresponding value as a short text next to each build.
For badges, you can choose from the 16x16 icons provided by Jenkins or from the icons provided by this plugin. Some of the names of groovy-postbuild icons conflict with the names of Jenkins icons (e.g. yellow.gif). For these icons, you have to provide the complete path (e.g. /images/16x16/yellow.gif), in case you want a badge with the Jenkins icon. You can also use icons provided by other plugins (e.g. Green Balls), by specifying the complete path to the icon.
The script below displays on the build summary page all classes that use Sun proprietary API.
The script below removes all badges and summaries from previous builds.
The script below marks the running build as deployed and the previous build as undeployed.
The script below changes the description of the first failed test.
Can use now additional classpath for groovy postbuild scripts to have them in a central location. Scriptler Plugin?
Skip to end of metadata Go to start of metadata