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

Build parameters not getting propagated in Pipeline (jenkinsfile).

XMLWordPrintable

      When using a Jenkinsfile, if I define a build parameter the parameter is not passed down into the slave/node execution so there's not way to access the values of the build parameter.

      An example Jenkinsfile would be:

      properties([[$class: 'ParametersDefinitionProperty', parameterDefinitions: [[$class: 'StringParameterDefinition', name: 'mode', defaultValue: 'normal']]]])
      node {
        sh "env"
      }
      

      In the example above, I would expect that when I echo 'env' in my slave/node, I should see a environment variable called 'mode' with a value of 'normal' (by default). However, this is not what I see. It seems that the environment variable mode is omitted.

            Unassigned Unassigned
            mdelaney Mike Delaney
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: