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

Add support for defining Declarative pipelines in shared libraries

    Details

    • Similar Issues:

      Description

      I have project https://github.com/patope/jenkins-pipeline-test having two branches: master and direct. On 'direct' pipeline is defined in Jenkinsfile file and on master Jenkinsfile uses shared pipeline.

      Shared pipeline is defined in https://github.com/patope/jenkins-pipeline-test-shared

      On branch 'direct' stage 'Build 2' is skipped correctly.

      On branch 'master' (using shared pipeline) stage 'Build 2' is executed. 

       

      pipeline {
        agent any
        stages {
          stage('Build 1') {
            when { expression { true } }
            steps {
              echo('1')
            }
          }
          stage('Build 2') {
            when { expression { false } }
            steps {
              echo('2')
            }
          }
          stage('Build 3') {
            when { expression { true } }
            steps {
              echo('3')
            }
          }
        }
      }
      

       

        Attachments

          Issue Links

            Activity

            patope Tomi Pakarinen created issue -
            abayer Andrew Bayer made changes -
            Field Original Value New Value
            Link This issue is duplicated by JENKINS-46558 [ JENKINS-46558 ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Summary Declarative pipeline 'when' conditions do not work when using shared pipeline Add support for defining Declarative pipelines in shared libraries
            abayer Andrew Bayer made changes -
            Issue Type Bug [ 1 ] New Feature [ 2 ]
            abayer Andrew Bayer made changes -
            Link This issue is blocking JENKINS-42730 [ JENKINS-42730 ]
            abayer Andrew Bayer made changes -
            Link This issue relates to JENKINS-42224 [ JENKINS-42224 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #193 (Web Link)" [ 17668 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            reinholdfuereder Reinhold Füreder made changes -
            Attachment image-2017-09-26-08-37-46-034.png [ 39855 ]
            bitwiseman Liam Newman made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                patope Tomi Pakarinen
              • Votes:
                2 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: