开发者

How to fail a Hudson job if a certain string occurs in console output

开发者 https://www.devze.com 2023-01-26 21:20 出处:网络
is there a way to make a hudson job fail if a certain string occurs in the console output? The reason I ask is because we have some jobs that deploy EAR files (via mvn commands) and even though the j

is there a way to make a hudson job fail if a certain string occurs in the console output?

The reason I ask is because we have some jobs that deploy EAR files (via mvn commands) and even though the job runs successfully, I see a string like this:

<26-Nov-2010 14:05:32 o'clock CET> <Info> <J2EE Deployment SPI> <BEA-260121> 
<Initiating undeploy operation for application, legacyservice [archive: null], 
to cde-server-c01 .>

[Deployer:149163]The domain edit lock is owned by another session in non-exclusive 
mode - this deployment operation requires exclusive access to the edit lock 
and hence cannot proceed.
ExitException: status 1
[INFO] Ignore exit
[INFO] Weblogic un-deployment 开发者_如何学Csuccessful 

I have tried fiddling with the maven command, but it does not really fail. So I wonder, if there was another way to detect this flaw and fail the job.

I imagine failing the job if a string like this occurs:

requires exclusive access to the edit lock and hence cannot proceed.

I am either interested in a hudson plugin that can do this, or a native way of configure my job for this


This is what you are looking for:

http://wiki.hudson-ci.org/display/HUDSON/Log+Parser+Plugin

You can edit the parsing rules file to include any text you want. This should let you use the text requires exclusive access to the edit lock and hence cannot proceed. as a regex in the parsing file. The instructions on the wiki page above are quite clear.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号