Thanks.

I like the try/catch/finally option if that would work.

I have setup a Pipeline Organization to auto-import my Scripts.

it sets up all the necessary repos  to build each one.

The problem occurs that I have no way to set the typical "email on success/email on failure" (I am also a contributor to a plugin that does Notification).

I could hardcode all my jobs or even use the Jenkins config DSL, but that would defeat the purpose of having the auto-import of a Multi-Branch Company setup.

I like the idea of helpers for other DSL items.. Maybe one to simulate the Config DSL from to set properties, endpoints, notifications somehow ?

What I really would like to do is use the DSL Script to reproduce the Notifications, emails, etc. within my script. (identified as post-action).

For now, I'll try to do it all in each script based on your exception.

Here's what I would like to do (from auto-import of Jenkinsfile to create new builds)....

- If an error occurs, continue anyways....

So, I guess what I'm looking for is.

try {
step 1
step 2
step 3
step 4
step 4
}
catch
{
task {send email of build status}
}
finally
{
task {send email of build status}
}


Thanks !! for your help.. If anything, an example of try/catch finally would be helpful. I would see what I could do to share back.

Much appreciated.

Mike Caspar




On 2016-05-05 3:12 PM, Baptiste Mathus wrote:

Hi,

There's no such concept in pipeline.

As Jesse explained: "the idea is that a Pipeline script is just a script: it runs the stuff you specified if and when you want it to. Whereas plugins contributing options to freestyle projects hardcode a lot of logic about when and whether something will happen, or make it a GUI configuration option, a Pipeline script is expected to define its own logic. We can always add convenience methods and DSLs on top of that for common usage patterns."

In your case, to do something on failure, you would typically use a try/catch/finally block.

If you are more specific on what you're trying to achieve, we might be able to help you more.

Cheers

Le 5 mai 2016 5:56 PM, "Mike Caspar" <mikecanbefo...@gmail.com <mailto:mikecanbefo...@gmail.com>> a écrit :

    Hi there,

    I am converting a series of jobs to pipeline jobs.

    I am not having any luck in finding the post-action stage  or
    finding a way to do this.

    a 'step' isn't appropriate to the situation (as it won't trigger
    on failed).

    If someone knows the answer to this, I would be happy to go over
    to the docs and update once I get this working.

    Ideas?





-- 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-users+unsubscr...@googlegroups.com
    <mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/jenkinsci-users/8b403f7e-a245-4e47-bd8f-185b5094d71a%40googlegroups.com
    
<https://groups.google.com/d/msgid/jenkinsci-users/8b403f7e-a245-4e47-bd8f-185b5094d71a%40googlegroups.com?utm_medium=email&utm_source=footer>.
    For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/5sN7BR7daOs/unsubscribe. To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscr...@googlegroups.com <mailto:jenkinsci-users+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS6Y%2BdXKsAU2_0tTommH-DLjqDa1h8NGx%2B_1wRycW3odVQ%40mail.gmail.com <https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS6Y%2BdXKsAU2_0tTommH-DLjqDa1h8NGx%2B_1wRycW3odVQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/86731502-3669-3f2a-6a72-e392699deba4%40caspar.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to