post build task

20 views
Skip to first unread message

06v...@gmail.com

unread,
May 21, 2013, 6:00:44 AM5/21/13
to jenkins...@googlegroups.com
Hi,
This could be a common issue, but i could not find correct solution. My requirement is based build status whether Fail or success, i should trigger windows batch file and pass build status as parameter which does some activity.
I am using Post build task plugin. I have added two tasks FAILURE and SUCCESS. when i test it if build is failed it is executing failure task and but also it is executing success task. Not sure why it is happening. But i am expecting it should execute only one task failure or success task. I am unable to figure it out, what is the issue. I have attached the screen shot of configuration. please help me. 

Cheers
Virg
jenkins.png
Message has been deleted

Eric Pyle

unread,
May 23, 2013, 1:36:39 PM5/23/13
to jenkins...@googlegroups.com
Hi Virg,

When you put in the text SUCCESS in the post build task "Log text" box,
it is not checking whether the build ended with status success; rather
it does a simple search for the text "SUCCESS" anywhere in the build log
during the post-build phase. Same for "FAILURE". So I would guess
somewhere in the build log you find the words SUCCESS and FAILURE.

One option would be to have your main build script decide whether it
succeeded or failed, and then echo a distinctive message to the log.
Search for that message in your post build tasks. Because you want to
run a batch script with success or failure as the argument, you can use
a regular expression as shown in the help for post build task. So if
your main build script echoes "This build result: success" or "This
build result: failure" then you can use the Log text expression "This
build result: success" and the Script "D:\\run.cmd success". Add a
corresponding task for failure.

Regards,
Eric
> --
> You received this message because you are subscribed to the Google
> Groups "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jenkinsci-use...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Reply all
Reply to author
Forward
0 new messages