Hello Ingo

Thanks for your response. We are using Jenkins 1.474 and Groovy Post build
version is 1.7

Can you please share with me the snippet if possible.

 Another observation is that, if i disable sonar analysis in the job and
give a diff string to mark un-stabilize the Build, the same snippet just
works well.

Thanks,
Krishna Chaitanya


On Mon, Aug 13, 2012 at 11:47 AM, Ingo Richter <ingo.rich...@gmail.com>wrote:

> Does the script execution fail with an error? Do you see something in the
> log?
> Which version of jenkins/groovy are you running?
> I have a similar snippet running properly on my machines.
>
> Ingo
> --
> San Francisco Blog <http://8880km.blogspot.com>
> "today is tomorrows past blog" <http://ingorichter.blogspot.com>
> LinkedIn Profile: <http://www.linkedin.com/in/ingorichter>
> twitter: <http://twitter.com/ingorichter>
>
>
>
> On Mon, Aug 13, 2012 at 10:24 AM, krishna chaitanya kurnala <
> kkc...@gmail.com> wrote:
>
>> Hello All
>>
>> Just want to know, if there is a way, to mark a jenkins build as unstable
>> based on Sonar Analysis results.
>>
>> I tried to use sonar build breaker plugin(
>> http://docs.codehaus.org/display/SONAR/Build+Breaker+Plugin) , to
>> analyse sonar results and mark a build as Failure. I then tried to then
>> change the status of Build to Un-stable with Groovy Post Build Plugin, here
>> is the groovy snippet:
>> if(manager.logContains(".*Build Step SONAR marked Build as FAILURE.*")) {
>>     manager.createSummary("warning.gif").appendText("<h1>You have been
>> warned!</h1>", false, false, false, "red")
>>     manager.buildUnstable()
>> }
>>
>> But, the above script is failing to change status of build. Please help.
>> If possible.
>>
>> Thanks,
>> Krishna Chaitanya
>>
>
>

Reply via email to