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

Logs lost for declarative parallel child job builds

XMLWordPrintable

      When using declarative pipelines in combination with parallel builds and sub job starting, the build logs are lost.

       

      Example: 

      stage('Check pipelines') {
              parallel {
                  stage('Check Java pipeline') {
                      steps {
                          script {
                              build job:'../dcx-service-template/master',
                              parameters: [string(name: 'SHARED_PIPELINE_BRANCH', value: "${GIT_BRANCH}")]
                          }
                      }
                  }
                  stage('Check NodeJs pipeline') {
                      steps {
                          script {
                              build job:'../jenkins-pipeline-testing-nodejs/master',
                              parameters: [string(name: 'SHARED_PIPELINE_BRANCH', value: "${GIT_BRANCH}")]
                          }
                      }
                  }
              }
          }
      }
      

      This will work and execute properly, but the build logs will disappear after the firrst "build job", which will make it look like this : 

      [...]
      [Pipeline] // stage
      [Pipeline] stage
      [Pipeline] { (Check pipelines)
      [Pipeline] parallel
      [Pipeline] { (Branch: Check Java pipeline)
      [Pipeline] { (Branch: Check NodeJs pipeline)
      [Pipeline] script
      [Pipeline] {
      [Pipeline] script
      [Pipeline] {
      [Pipeline] build (Building ShopDirect » dcx-service-template » master)
      Scheduling project: ShopDirect » dcx-service-template » master
      [Pipeline] build (Building ShopDirect » jenkins-pipeline-testing-nodejs » master)
      
      

      And the logs will stop there instead of displaying the number of the child jobs once they start, and display the following steps logs

            Unassigned Unassigned
            sdurand Samuel Durand
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: