Executing a script depending on the build status.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Executing a script depending on the build status.

Jorge Vargas
Hello,

I'm trying to execute a notifier (which is a standalone program we use
internally that sends several things, irc, email, etc.) however I'm
hitting several road blocks and this can't be that complicated.

method #1

Using http://wiki.hudson-ci.org/display/HUDSON/Post+build+task

Problem with #1

Grepping the logfile for failures is a problem, as there is no clear
indication of the failure in the logfile. What we really need is the
ability to access hudson's own indicator variable.

enter method #2

Using http://wiki.hudson-ci.org//display/HUDSON/Groovy+Postbuild+Plugin

Problem with #2

This plugin let me have very good logic to determine the output of the
build. However it does not let me execute my shell script ?

println "Groovy"
println "ls -al".execute()
println manager.buildFailure()

Lines 1 and 2 of the above do not work.


Has anyone done something like this?
Reply | Threaded
Open this post in threaded view
|

Re: Executing a script depending on the build status.

Hendryk Bockelmann
Hey Jorge,

why don't you use the Parameterized Trigger Plugin
http://wiki.hudson-ci.org/display/HUDSON/Parameterized+Trigger+Plugin
to start a new job that only executes your notifier?!
This plugin allows to trigger only if build is:
- stable
- unstable
- stable or unstable but not failed
- failed
- complete (always trigger)
as a benefit you might then as well pass extra parameter to the new job

On 19/01/11 22:03, Jorge Vargas wrote:

> Hello,
>
> I'm trying to execute a notifier (which is a standalone program we use
> internally that sends several things, irc, email, etc.) however I'm
> hitting several road blocks and this can't be that complicated.
>
> method #1
>
> Using http://wiki.hudson-ci.org/display/HUDSON/Post+build+task
>
> Problem with #1
>
> Grepping the logfile for failures is a problem, as there is no clear
> indication of the failure in the logfile. What we really need is the
> ability to access hudson's own indicator variable.
>
> enter method #2
>
> Using http://wiki.hudson-ci.org//display/HUDSON/Groovy+Postbuild+Plugin
>
> Problem with #2
>
> This plugin let me have very good logic to determine the output of the
> build. However it does not let me execute my shell script ?
>
> println "Groovy"
> println "ls -al".execute()
> println manager.buildFailure()
>
> Lines 1 and 2 of the above do not work.
>
>
> Has anyone done something like this?


smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Executing a script depending on the build status.

Jorge Vargas
Hello Hendryk,

Thank you for your tip, I'll try that plugin and let you know.

On Thu, Jan 20, 2011 at 3:58 AM, Hendryk Bockelmann <[hidden email]> wrote:

> Hey Jorge,
>
> why don't you use the Parameterized Trigger Plugin
> http://wiki.hudson-ci.org/display/HUDSON/Parameterized+Trigger+Plugin
> to start a new job that only executes your notifier?!
> This plugin allows to trigger only if build is:
> - stable
> - unstable
> - stable or unstable but not failed
> - failed
> - complete (always trigger)
> as a benefit you might then as well pass extra parameter to the new job
>
> On 19/01/11 22:03, Jorge Vargas wrote:
>>
>> Hello,
>>
>> I'm trying to execute a notifier (which is a standalone program we use
>> internally that sends several things, irc, email, etc.) however I'm
>> hitting several road blocks and this can't be that complicated.
>>
>> method #1
>>
>> Using http://wiki.hudson-ci.org/display/HUDSON/Post+build+task
>>
>> Problem with #1
>>
>> Grepping the logfile for failures is a problem, as there is no clear
>> indication of the failure in the logfile. What we really need is the
>> ability to access hudson's own indicator variable.
>>
>> enter method #2
>>
>> Using http://wiki.hudson-ci.org//display/HUDSON/Groovy+Postbuild+Plugin
>>
>> Problem with #2
>>
>> This plugin let me have very good logic to determine the output of the
>> build. However it does not let me execute my shell script ?
>>
>> println "Groovy"
>> println "ls -al".execute()
>> println manager.buildFailure()
>>
>> Lines 1 and 2 of the above do not work.
>>
>>
>> Has anyone done something like this?
>
>