edla
edla

Reputation: 1

downstream jenkins job does not get aborted if upstream job is aborted

Two jenkins jobs are connected as: Upstream job is a pipeline and triggers a freestyle job.

Is it possible in Jenkins to get the following scenario:

If downstream job is aborted the upstream job gets aborted. But if the upstream job is aborted the downstream job should not abort, but continue running.

Upstream job :
    node('upstream_node'){
    build job: 'downstream_job', wait:true, propagate:false
    }

I have tried all possible combinations with 'wait' and 'propagate' options, but non of them will work.

Upvotes: 0

Views: 1453

Answers (2)

edla
edla

Reputation: 1

Found the solution.

Using the lock plugin in Jenkins

How can I block a Jenkins 2.x Pipeline job while dependent jobs are building

Upvotes: 0

Arnaud Claudel
Arnaud Claudel

Reputation: 3138

Use propagate:true instead of false.

This is from the documentation :

  • propagate (optional)
    If set, then if the downstream build is anything but successful (blue ball), this step fails. If disabled, then this step succeeds even if the downstream build is unstable, failed, etc.; use the result property of the return value as needed.

Upvotes: 1

Related Questions