Post build task

Plugin Information

Plugin ID postbuild-task
Latest Release 1.7
Latest Release Date Jun 03, 2010
Changes via Fisheye In Latest Release
Since Latest Release
Maintainer(s) Shinod Mohandas (id: shinodkm)
Fred (id: castorpilot)
Issue Tracking Open Issues

This plugin allows the user to execute a shell/batch task depending on the build log output.Java regular expression are allowed.

This feature allows user to associate shell or a batch scripts that perform some tasks on Hudson depending on the build log output.If the log text has a match some where in the build log file, the script will execute and the post build log will append to the project build log. Java regular expression are allowed.

Usage

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

Example:1

'BUILD FAILED' OR 'IOException' AND 'Building remotely'
'BUILD FAILED' matches so --> 'true'
'IOException' does not match so --> 'false'
'Building remotely' matches so --> 'true'
((true OR false) AND true) --> 'true' (does execute)

Example:2

'BUILD FAILED' AND 'IOException' AND 'Building remotely'
'BUILD FAILED' matches so --> 'true'
'IOException' does not match so --> 'false'
'Building remotely' matches so --> 'true'
((true AND false) AND true) --> 'false' (does not execute)

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: 10", the "script.sh 4" 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 dependin 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

Changelog

Version 1.7 (2010/06/03)

  • Added Spanish translation

Version 1.5 (2009/09/15)

  • Added multiple searches for log text.they could be joined by an 'And' or an 'Or'.
  • Removed grouping for the time being.

Version 1.3 (2009/09/07)

  • Added regex option for log text

Version 1.1 (2009/08/26)

  • Initial version

Labels:

plugin-post-build plugin-post-build Delete
plugin-builder plugin-builder Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Oct 26, 2009

    Andrey says:

    Is it possible to add   environment variables to this plug-in ? It wil...

    Is it possible to add   environment variables to this plug-in ?
    It will be useful if BUILD_ID, JOB_NAME and other variables will be available to use

    1. Apr 13

      Horst Scholl says:

      any changes here?

      any changes here?

  2. Mar 25

    Tech Release says:

    We have 3 Hudson running: Master (only web interface) Slave1 & Slave2 for sc...

    We have 3 Hudson running: Master (only web interface) Slave1 & Slave2 for scheduling. I'm afraid that the workspace for "post build task" plugin is on Master, isn't it? I'm asking if it's possible to run "post build task" (like rsync command) on the slave that run the job. Thanks

    1. Mar 25

      Shinod Mohandas says:

      "post build task" plugin run the command on the machine where the job is running...

      "post build task" plugin run the command on the machine where the job is running. if the job is running on the node(slave)the command will be executed on the node.

      1. Mar 25

        Tech Release says:

        You are right :D ... doing more deep tests I find that "post build task" plugin ...

        You are right :D ... doing more deep tests I find that "post build task" plugin does not access to variable defined into Global properties / Environment variables.I use a command $root_rsync defined as "Environment variable" (to reuse it on many jobs defining rsync pathname only once)

        root_rsync = /opt/hudson-rsync/scripts/noname.rsync

        Can be this my problem?

        1. Mar 25

          Tech Release says:

          let me to confirm that I replicate same key/value pari into any slave configurat...

          let me to confirm that I replicate same key/value pari into any slave configurations

          1. Mar 25

            Shinod Mohandas says:

            i will do the necessary changes to add the env variable to this plugin. right no...

            i will do the necessary changes to add the env variable to this plugin.
            right now it wont take the env variable.

            1. Mar 25

              Tech Release says:

              Great!

              Great!

  3. Jun 24

    Thiago Leão Moreira says:

    Hi there, The replace operation of the regexp groups is not working. Seems that...

    Hi there,

    The replace operation of the regexp groups is not working. Seems that the code that makes the replace is commented out. Can you confirm this?