[BlueOcean] 'When' Closure in a nested stage

14 views
Skip to first unread message

Ram Kamath

unread,
Sep 27, 2017, 11:06:47 AM9/27/17
to Jenkins Users
Hello,

I have a pipeline like below. And skip stage(when Closure) works fine. 

pipeline {
   agent any
   stages {
       stage('Build') {
                when { expression { false } }
           parallel {
               stage('Backend') {
                   steps {
                       buildbackend
                   }
               }
               stage('Frontend') {
                   steps {
                       buildfrontend
                   }
               }
           }
       }
   }
}










However, when I move the when Closure to one of the 2 nested stages. It doesn't work. I really appreciate if there is any help in this regard.

pipeline {
  agent any
  stages {
      stage('Build') {
          parallel {
              stage('Backend') {                
                 when { expression { false } }                  
                 steps {
                      buildbackend
                  }
              }
              stage('Frontend') {
          when { expression { false } } 
                  steps {
                      buildfrontend
                  }
              }
          }
      }
  }
}


My log indicates that the stages are skipped.
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] parallel
[Pipeline] [Backend] { (Branch: Backend)
[Pipeline] [Frontend] { (Branch: Frontend)
[Pipeline] [Backend] stage
[Pipeline] [Backend] { (Backend)
[Pipeline] [Frontend] stage
[Pipeline] [Frontend] { (Frontend)
Stage 'Backend' skipped due to when conditional
Stage 'Frontend' skipped due to when conditional
[Pipeline] [Backend] }
[Pipeline] [Frontend] }
[Pipeline] [Backend] // stage
[Pipeline] [Frontend] // stage
[Pipeline] [Backend] }
[Pipeline] [Frontend] }
[Pipeline] // parallel
[Pipeline] }
[Pipeline] // stage

But BlueOcean doesn't display it.



Kind RegardsRam

Reply all
Reply to author
Forward
0 new messages