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

Add ability to have artifacts with the same name in parallel pipeline stages

XMLWordPrintable

      I have a pipeline script that runs parallel builds and captures artifacts from each build. The artifacts all have the same name and path. The pipeline syntax doesn't offer a way to namespace these artifacts or bundle particular builds together so they don't overwrite each other. Here's a snippet of my script that should reproduce the problem.

      pipeline {
          agent none
          stages {
              stage("Build/Test") {
                  steps {
                      script {
                          def builds = [:]
                          
                          for (def config in ["debug", "default", "opt"]) {
                                  def config_inside = "${config}"
                                  
                                  builds["${config_inside}"] = {
                                      node ("node001") {
                                          stage("Build Test ${config_inside}") {
                                              sh "$HOME/software/jenkins_scripts/nightly.sh ${config_inside} gnu yes $WORKSPACE"
                                              junit allowEmptyResults: true, testResults: 'test/mpi/summary.junit.xml'
                                              archiveArtifacts 'filtered-make.txt,c.txt,**/config.log,m.txt,mi.txt,test/mpi/summary.junit.xml'
                                          }
                                      }
                                  }
                              }
                          }
                          
                          parallel builds
                      }
                  }
              }
          }
      }
      

            Unassigned Unassigned
            wbland Wesley Bland
            Votes:
            7 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: