Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37781

Pipeline Config: ability to skip whole pipeline or stages based on boolean condition

      A common enough pattern is to skip either a whole pipeline or a stage based on the branch of execution. This is pretty common in deployment focused pipelines, and would be a strong reason to break out of config and that would be a shame.

      It would be nice if this was somewhat first class in pipeline config. Some may be able to be done with a block scoped step... but not clear if all can be.

      A general way of saying "if this boolean condition is false, skip this stage" would be the way to go - a branch matching would be one particular use of this, but the right thing to do is go generic.

          [JENKINS-37781] Pipeline Config: ability to skip whole pipeline or stages based on boolean condition

          James Dumay added a comment -

          Sorry mkobit - for the time being the nice new visualisation bells and whistles will be declarative only

          James Dumay added a comment - Sorry mkobit - for the time being the nice new visualisation bells and whistles will be declarative only

          Mike Rylander added a comment -

          jamesdumay Is there a ticket that I could watch/vote for adding this to the scripted pipeline?

          Mike Rylander added a comment - jamesdumay Is there a ticket that I could watch/vote for adding this to the scripted pipeline?

          Ad comments/requests from mkobit and msrylander: I'd be happy about that too, especially since due to https://issues.jenkins-ci.org/browse/JENKINS-46547 most non-straightforward declarative pipelines in shared libraries need to be converted into scripted pipelines...

          Reinhold Füreder added a comment - Ad comments/requests from mkobit and msrylander : I'd be happy about that too, especially since due to https://issues.jenkins-ci.org/browse/JENKINS-46547 most non-straightforward declarative pipelines in shared libraries need to be converted into scripted pipelines...

          James Dumay added a comment -

          msrylander there isn't a ticket for supporting this in scripted pipeline.

          James Dumay added a comment - msrylander there isn't a ticket for supporting this in scripted pipeline.

          => therefore filed https://issues.jenkins-ci.org/browse/JENKINS-47286 "Support skipping stages in scripted pipelines for nice visualization in blue ocean and classic UI stage view"

          Reinhold Füreder added a comment - => therefore filed https://issues.jenkins-ci.org/browse/JENKINS-47286 "Support skipping stages in scripted pipelines for nice visualization in blue ocean and classic UI stage view"

          Nat Sr added a comment -

          jamesdumay rsandell I see this ticket is resolved and wonder when and what release will it out? Could you guys please answer it? Thanks

          Nat Sr added a comment - jamesdumay rsandell I see this ticket is resolved and wonder when and what release will it out? Could you guys please answer it? Thanks

          It's "resolved" as POSTPONED. So it's not fixed. Also, closing issues like that doesn't allow people to vote for them, which kind of sucks (I've seen it for other issues like supporting labels to steps).

          Leandro Lucarella added a comment - It's "resolved" as POSTPONED. So it's not fixed. Also, closing issues like that doesn't allow people to vote for them, which kind of sucks (I've seen it for other issues like supporting labels to steps).

          Andrew Bayer added a comment -

          Huh? We released the when directive for Declarative ages ago.

          Andrew Bayer added a comment - Huh? We released the when directive for Declarative ages ago.

          Leandro Lucarella added a comment - - edited

          Sorry, I think I got the comments mixed up, I was replying about scripted pipelines:

          => therefore filed https://issues.jenkins-ci.org/browse/JENKINS-47286 "Support skipping stages in scripted pipelines for nice visualization in blue ocean and classic UI stage view"

          Leandro Lucarella added a comment - - edited Sorry, I think I got the comments mixed up, I was replying about scripted pipelines: => therefore filed https://issues.jenkins-ci.org/browse/JENKINS-47286 "Support skipping stages in scripted pipelines for nice visualization in blue ocean and classic UI stage view"

          Liam Newman added a comment -

          Bulk closing resolved issues.

          Liam Newman added a comment - Bulk closing resolved issues.

            rsandell rsandell
            abayer Andrew Bayer
            Votes:
            3 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved: