https://stackoverflow.com/questions/26026431/how-to-fast-fail-jenkins-build-flow-plugin-job/26026432#26026432
On Mon Nov 10 2014 at 8:35:18 AM Ginga, Dick <[email protected]> wrote: > Having looked at this again, you should be able to do what you want in > the shell script itself. I am not an expert here, so I will not attempt a > solution. > > > > Find the Build Flow Plugin details here: > > > > https://wiki.jenkins-ci.org/display/JENKINS/Build+Flow+Plugin > > > > you would create a Jenkins job for each step. > > Each job would have to return success or failure. > > In the Build Flow window, you would do something like this: > > > > a=build(“Build-Step-1”) > > > > if (a.result =~ "SUCCESS") { > > b=build(“Build-Step-2”) > > } > > else { > > build.setResult(“SUCCESS”) > > } > > > > > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of *Panikera Raj > *Sent:* Monday, November 10, 2014 11:23 AM > *To:* [email protected] > *Subject:* Re: Stop the execution if First task is failed even if > multiple tasks are added to the project > > > > Can you provide code snippet or can you explain bit more about how to > use and where to specify... > > > > > > Regards, > > Panikera > > > > On Mon, Nov 10, 2014 at 7:08 PM, Ginga, Dick <[email protected]> > wrote: > > You can certainly do it with the Build Flow (DSL) plugin > > > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of *Panikera Raj > *Sent:* Monday, November 10, 2014 8:36 AM > *To:* [email protected] > *Subject:* Fwd: Stop the execution if First task is failed even if > multiple tasks are added to the project > > > > > > Hi All, > > I have a project in Jenkins (as free style project) where I have added > multiple tasks as an attachment. As I showed in attachment in first task > condition is not satisfied I need to come out from the execution I don't > want to execute second task. > > I can put *exit 1*. But If condition is not matched project will get > marked as Failure and mail will go to every one. So if put just *exit 0.* > It will come out from the first task then once again second task will > execute. I don't want to be execute like this. > > Is there a way where if first task not satisfied condition we can come out > from complete execution(with out executing second task) > > Regards, > Panikera > > > > > > -- > 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 [email protected]. > For more options, visit https://groups.google.com/d/optout. > > -- > 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 [email protected]. > > > For more options, visit https://groups.google.com/d/optout. > > > > -- > 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 [email protected]. > For more options, visit https://groups.google.com/d/optout. > > -- > 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 [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
