Hi Sekhar,

GoCD fails a job when a given task fails, i.e. if you execute a command 
which result in a non-zero value - the task has failed and so the job will 
fail.
E.g. 
<exec command="/bin/bash">
                <arg>-c</arg>
                <arg>if [ \"${SHOULD_FAIL}\" != 'true ]; then echo 
\"Failing the job\"; exit 1; fi</arg>
 </exec>

Hope this helps!

Kritika

On Friday, June 12, 2020 at 1:07:24 PM UTC+5:30 [email protected] wrote:

> Hi,
>
> I'm quite new to GoCD and I'm trying to figure out if it possible to break 
> a build pipeline or forcibly fail a pipeline based on a condition?
>
> My exact requirements are to declare a threshold variable and if that 
> threshold is crossed the stage/pipeline is to be failed forcibly and the 
> subsequent execution of pipeline is stopped.
>
> And if there are conditional statements(like if else) or support for 
> logical statements(like &,&&,|,||,<,<=,>,>= etc) it makes the job easier 
> for me as I can control the flow control to stages or other pipelines.
>
> Thanks in advance.
>
> Regards,
> Sekhar Routray
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/c03d853f-290c-469e-8a47-c2000912a291n%40googlegroups.com.

Reply via email to