This blog post might be insightful - 
http://delivervalue.blogspot.co.uk/2013/06/more-advanced-build-flows-with-jenkins.html

It does show you how to run a number of similar jobs in parallel and then 
send the resulting build numbers to a downstream job.

It does not, however, show you how to download artifacts from these builds. 
This cannot be achieved by Copy Artifact Plugin as one has to loop around 
the build numbers (assuming they are from the same job). A simple Gradle 
build step or a Groovy build step can achieve this for you.

An example Gradle build step could contain something like the following:

buildscript {
    repositories {
        mavenCentral()
        mavenRepo(url: 'http://dl.bintray.com/ysb33r/grysb33r')
      }
      dependencies {
        classpath 'org.ysb33r.gradle:vfs-gradle-plugin:0.2'
        classpath 'commons-httpclient:commons-httpclient:3.1'
      }
}

apply plugin: 'vfs'
project.ext.JENKINS_URL = System.env['JENKINS_URL]

task download << {
  BUILD_NUMBERS.split(',').each { buildNum ->
    vfs.cp 
"${JENKINS_URL}/job/${SOURCE_JOB}/${buildNum}/artifact/NAME_OF_YOUR_ARTIFACT", 
new File('LOCAL_NAME_OF_ARTIFACT'), overwrite:true
  }
}

This script can now be called with parameters
-PSOURCE_JOB=YourJenkinsJobName
-PBUILD_NUMBERS=1,2,3,4,5
and task name
download

HTH

--
Schalk W. Cronjé

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to