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

Stage still shown with NaNy NaNd when condition returns false

XMLWordPrintable

      Conditional stages when false are not hidden anymore. It worked before so the problem was introduce with latest updates.

      This is the Jenkinsfile code we use, which worked for previous versions and is ok according to the when pipeline syntax.

      pipeline {
          agent any
      
          stages {
              stage('Checkout dev') {
                  when {
                      expression { env.GIT_BRANCH == 'origin/dev' }
                  }
                  steps {
                      echo "\u001B[32mCheckout dev OK\u001B[m"
                  }
              }
              stage('Checkout master') {
                  when {
                      expression { env.GIT_BRANCH == 'origin/master' }
                  }
                  steps {
                      echo "\u001B[32mCheckout master OK\u001B[m"
                  }
              }
      ...
      

       

            svanoort Sam Van Oort
            philip_sultanescu Philip Sultanescu
            Votes:
            20 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated: