Search code examples
jenkinsjenkins-pluginsbuild-automationjenkins-pipelinejenkins-workflow

Notify Upstream job when Child is success or retry count reached


I've two Jobs say Parent and Child. Parent calls child and is blocked until child finishes build. Now I'm using the Naginator plugin to retry child on failure.

I want the control to return back to parent only when retry max count is reached or if child is success (as it won't retry if success). Currently the Child retries on failure and even if the later build is success, the parent is marked as failure cause its referring to 1st build triggered which was a failure.

I've tried build blocker plugin to block parent till child finishes all retries but still Parent points to the 1st child build number. Any pointers on which plugin can help me achieve this requirement? Thanks in advance.


Solution

  • I think this is more of a question for Naginator plugin.

    On the contrary, why not use Build flow plugin native retry function in your upstream pipeline?

    retry ( 3 ) {
        build( "this_job_may_fail" )
    }