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

BUILD_SELECTOR is not passed to matrix subprojects

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • copyartifact-plugin
    • Jenkins: 2.5, Linux x64, Java 1.8.0_91, matrix-project 1.6, copyartifact 1.38

    Description

      A parameter of the type "Build selector for Copy Artifact" works fine when using it in an freestyle job, it copies the artifacts and the windows script

      echo "%BUILD_SELECTOR%"

      prints as expected:

      00:00:00.059 [IntegrationTest] $ cmd /c call C:\Users\JENKIN~1\AppData\Local\Temp\hudson******.bat
      00:00:00.095 
      00:00:00.095 C:\Jenkins\workspace\******>echo "<TriggeredBuildSelector plugin="copyartifact@1.38">  <fallbackToLastSuccessful>true</fallbackToLastSuccessful>  <upstreamFilterStrategy>UseNewest</upstreamFilterStrategy>  <allowUpstreamDependencies>true</allowUpstreamDependencies></TriggeredBuildSelector>" 
      00:00:00.095 "<TriggeredBuildSelector plugin="copyartifact@1.38">  <fallbackToLastSuccessful>true</fallbackToLastSuccessful>  <upstreamFilterStrategy>UseNewest</upstreamFilterStrategy>  <allowUpstreamDependencies>true</allowUpstreamDependencies></TriggeredBuildSelector>"
      00:00:00.095 
      00:00:00.095 C:\Jenkins\workspace\******>exit 0 
      00:00:00.107 Setting MSBUILD_12_HOME=C:\Program Files (x86)\MSBuild\12.0\Bin\
      00:00:09.371 Copied 603 artifacts from "******" build number 10
      

      When using the same setup (Build selector parameter; windows batch script and copy artifact step) in an matrix job, we get the following result:

      00:00:00.053 [******] $ cmd /c call C:\Users\JENKIN~1\AppData\Local\Temp\hudson******.bat
      00:00:00.096 
      00:00:00.096 C:\Jenkins\workspace\******>echo "" 
      00:00:00.096 ""
      00:00:00.097 
      00:00:00.097 C:\Jenkins\workspace\******>exit 0 
      00:00:00.110 Setting MSBUILD_12_HOME=C:\Program Files (x86)\MSBuild\12.0\Bin\
      00:00:00.112 ERROR: Unable to find a build for artifact copy from: Build2/BuildConfiguration=Debug,Slave=******
      

      It looks as if the parameter is not passed to the subproject created automatically for each combination. When specifying the Build selector directly (without variable, choosing "Upstream build that triggered this job" instead of "Specified by build selector"), the artifacts are copied.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              phi1010 Phillip Kuhrt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: