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

Trigger via script does not support LABEL

    Details

    • Similar Issues:

      Description

      UPDATE:

      I can circumvent this issue by using /job/JOBNAME/buildWithParameters instead. Deprioritized.

      When I try to specify the label parameter in launching my jenkins job like this:

      curl --silent --show-error --data 'json={"parameter":[

      {"name":"NODE_LABEL","value":"LABEL"}

      ]&Submit=Build' http://jenkins:8888/job/JOBNAME/build

      It seems to ignore it and I end up with an error message like this:

      00:00:00.018 FATAL: Null value not allowed as an environment variable: NODE_LABEL
      00:00:00.018 java.lang.IllegalArgumentException: Null value not allowed as an environment variable: NODE_LABEL
      00:00:00.019 at hudson.EnvVars.put(EnvVars.java:172)
      00:00:00.019 at org.jvnet.jenkins.plugins.nodelabelparameter.LabelParameterValue.buildEnvVars(LabelParameterValue.java:71)
      00:00:00.019 at hudson.model.ParametersAction.buildEnvVars(ParametersAction.java:82)
      00:00:00.019 at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:961)
      00:00:00.019 at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:776)
      00:00:00.019 at hudson.model.AbstractProject.checkout(AbstractProject.java:1353)
      00:00:00.019 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:689)
      00:00:00.019 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
      00:00:00.019 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:594)
      00:00:00.019 at hudson.model.Run.execute(Run.java:1567)
      00:00:00.019 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      00:00:00.019 at hudson.model.ResourceController.execute(ResourceController.java:88)
      00:00:00.019 at hudson.model.Executor.run(Executor.java:237)

        Attachments

          Activity

          Hide
          domi Dominik Bartholdi added a comment -

          you should use 'label' instead of 'value' as the key.

          curl --silent --show-error --data 'json={"parameter":[

          {"name":"NODE_LABEL","label":"LABEL"}

          ]}&Submit=Build' http://jenkins:8888/job/JOBNAME/build

          Show
          domi Dominik Bartholdi added a comment - you should use 'label' instead of 'value' as the key. curl --silent --show-error --data 'json={"parameter":[ {"name":"NODE_LABEL","label":"LABEL"} ]}&Submit=Build' http://jenkins:8888/job/JOBNAME/build
          Hide
          domi Dominik Bartholdi added a comment -

          In addition, I altered the code to also support 'value'...

          Show
          domi Dominik Bartholdi added a comment - In addition, I altered the code to also support 'value'...
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: imod
          Path:
          src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterDefinition.java
          http://jenkins-ci.org/commit/nodelabelparameter-plugin/e4aefbf737c70aa94356a96741653bae9019855d
          Log:
          [FIXED JENKINS-17660] for convenience, allow usage of ‘value’ for calls of label parameters via script

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterDefinition.java http://jenkins-ci.org/commit/nodelabelparameter-plugin/e4aefbf737c70aa94356a96741653bae9019855d Log: [FIXED JENKINS-17660] for convenience, allow usage of ‘value’ for calls of label parameters via script
          Hide
          domi Dominik Bartholdi added a comment -
          Show
          domi Dominik Bartholdi added a comment - I just released the 1.5.0-beta version with this, feedback very welcome: https://wiki.jenkins-ci.org/display/JENKINS/NodeLabel+Parameter+Plugin#NodeLabelParameterPlugin-1.5.0beta%2816.Jan2014%29

            People

            • Assignee:
              domi Dominik Bartholdi
              Reporter:
              hofan41 Ho-Fan Kang
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: