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

Triggered builds "for every property file" do not receive the parameters from the property files

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I set up job A which has a single Trigger/call builds on other projects build step which can be seen in the attached screenshot. It's set For every property file, invoke one build of job B. The File Pattern is /var/lib/jenkins/cases/*
       
      Job B ("case-runner" in the screenshot) is parameterized, it has a DATASET parameter and a single build step Execute shell "env". It is started as expected, but the DATASET parameter is not passed through even though it's specified in the property file.
       
       
      jenkins@instance-eval-jenkins:~$ ls -l /var/lib/jenkins/cases/
      total 4
      rw-rr- 1 jenkins jenkins 12 Apr 19 13:08 a
      jenkins@instance-eval-jenkins:~$ cat /var/lib/jenkins/cases/a
      DATASET=svo
       
      The DATASET parameter should be passed through according to the documentation: "This ParameterFactory generates parameters based on the contents of the files found."
       
      DATASET is passed fine if I specify it in a list of Predefined parameters, but not when it's in the property file, so it seems to be a problem with how the job is triggered. Both jobs run on the master Jenkins node. I also tried with "DATASET = svo" in the property file but still the same.
       

        Attachments

          Activity

          Hide
          aleb Alexandru Băluț added a comment - - edited

          It turns out it was a problem with how I specified the File Pattern. I noticed this in the Jenkins's system log file:

          java.io.IOException: Expecting Ant GLOB pattern, but saw '/var/lib/jenkins/cases/*'. See http://ant.apache.org/manual/Types/fileset.html for syntax
          at hudson.FilePath.glob(FilePath.java:1797)
          at hudson.FilePath.access$1900(FilePath.java:208)
          at hudson.FilePath$31.invoke(FilePath.java:1777)
          at hudson.FilePath$31.invoke(FilePath.java:1774)
          at hudson.FilePath.act(FilePath.java:1009)
          at hudson.FilePath.act(FilePath.java:987)
          at hudson.FilePath.list(FilePath.java:1774)
          at hudson.FilePath.list(FilePath.java:1758)
          at hudson.FilePath.list(FilePath.java:1743)
          at hudson.plugins.parameterizedtrigger.FileBuildParameterFactory.getParameters(FileBuildParameterFactory.java:109)
          at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.getDynamicBuildParameters(BuildTriggerConfig.java:493)
          at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.perform3(BuildTriggerConfig.java:458)
          at hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig.perform3(BlockableBuildTriggerConfig.java:67)
          at hudson.plugins.parameterizedtrigger.TriggerBuilder.perform(TriggerBuilder.java:93)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
          at hudson.model.Build$BuildExecution.build(Build.java:206)
          at hudson.model.Build$BuildExecution.doRun(Build.java:163)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
          at hudson.model.Run.execute(Run.java:1727)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
          

           

          I was able to use the "cases/*" File Pattern only after I made the "cases" folder available in the job's workspace directory:

          ln -s /var/lib/jenkins/cases/ /var/lib/jenkins/workspace/MY-JOB-NAME/

          It would be good if the plugin does not fail silently. I would consider the issue fixed if the help paragraph for the File Path explains that absolute paths are not valid values:

          File wildcard pattern for for finding parameter list files. For example 'Param*.txt' would generate a new configuration for each file that matches the pattern and use the properties defined in each file.
          (from Jenkins Parameterized Trigger plugin)

           

          Show
          aleb Alexandru Băluț added a comment - - edited It turns out it was a problem with how I specified the File Pattern. I noticed this in the Jenkins's system log file: java.io.IOException: Expecting Ant GLOB pattern, but saw '/ var /lib/jenkins/cases/*' . See http: //ant.apache.org/manual/Types/fileset.html for syntax at hudson.FilePath.glob(FilePath.java:1797) at hudson.FilePath.access$1900(FilePath.java:208) at hudson.FilePath$31.invoke(FilePath.java:1777) at hudson.FilePath$31.invoke(FilePath.java:1774) at hudson.FilePath.act(FilePath.java:1009) at hudson.FilePath.act(FilePath.java:987) at hudson.FilePath.list(FilePath.java:1774) at hudson.FilePath.list(FilePath.java:1758) at hudson.FilePath.list(FilePath.java:1743) at hudson.plugins.parameterizedtrigger.FileBuildParameterFactory.getParameters(FileBuildParameterFactory.java:109) at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.getDynamicBuildParameters(BuildTriggerConfig.java:493) at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.perform3(BuildTriggerConfig.java:458) at hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig.perform3(BlockableBuildTriggerConfig.java:67) at hudson.plugins.parameterizedtrigger.TriggerBuilder.perform(TriggerBuilder.java:93) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) at hudson.model.Run.execute(Run.java:1727) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)   I was able to use the "cases/*" File Pattern only after I made the "cases" folder available in the job's workspace directory: ln -s /var/lib/jenkins/cases/ /var/lib/jenkins/workspace/MY-JOB-NAME/ It would be good if the plugin does not fail silently. I would consider the issue fixed if the help paragraph for the File Path explains that absolute paths are not valid values: File wildcard pattern for for finding parameter list files. For example 'Param*.txt' would generate a new configuration for each file that matches the pattern and use the properties defined in each file. (from  Jenkins Parameterized Trigger plugin )  

            People

            • Assignee:
              Unassigned
              Reporter:
              aleb Alexandru Băluț
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: