This plugin allows the user to execute a shell/batch task depending on the build log output. Java regular expression are allowed.
When you install this plugin, your project configuration page gets additional "Post build task" option as illustrated below:
The Post build task consists of log texts and a script.For the multiple searches, log texts could be joined by an 'And' or an 'Or'. For example, if text "BUILD FAILED" OR "IOException" is found, then it runs the command. For multiple search click on the add button will create one option box (And & Or) and a new log text box.
If the log text has a match it is considered as true otherwise false. Do a bitwise operation for the total match results and if the bitwise result is true, the script will execute otherwise skip
'BUILD FAILED' OR 'IOException' AND 'Building remotely'
'BUILD FAILED' AND 'IOException' AND 'Building remotely'
Java Regex are allowed for matching log text. If the text is "Total time: (\d+)" and the script is "script.sh", then if the log contains a line "Total time: 12", the "script.sh 12" will be called.
Specify the shell script to be executed when the execution of the task is selected. This is where the actual work happens. When the script executes, the current directory will be the workspace directory, just like the shell script builder. So depending on your SCM, you might have to cd into a directory. Try "pwd" and "ls" to find out whether you need that or not.
Post build task plugin