• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • pipeline

      Right now there is no easy way to find, when writing a flow script, which environment variables will be predefined.

      EnvironmentContributor/EnvVarsHtml/index.groovy renders CoreEnvironmentContributor/buildEnv.groovy. This will be somewhat misleading since EXECUTOR_NUMBER, NODE_NAME, and NODE_LABELS are not currently set for flow builds (since they do not make sense in general, and buildEnvironment is not going to be called from an Executor thread). This page also seems to be documenting variables that CoreEnvironmentContributor does not actually set, including WORKSPACE (from AbstractBuild.getEnvironment) which is also not currently available for flow builds. Setting these variables from ExecutorStepExecution would be welcome. (BUILD_NUMBER, BUILD_ID, and BUILD_TAG are from Run.getCharacteristicEnvVars and are available for flows; likewise JOB_NAME from Job.getCharacteristicEnvVars—curiously JOB_URL is set by CoreEnvironmentContributor.)

      At any rate, linking to this page (${rootURL}/env-vars.html) from somewhere in the configuration page for a script would be welcome. Perhaps from help.* of the sh/bat scripts, analogous to the standard Jenkins usage from hudson/tasks/Shell/config.properties etc.?

          [JENKINS-27145] Advertise available environment variables

          Jesse Glick created issue -
          Tom FENNELLY made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Assignee Original: Jesse Glick [ jglick ] New: Tom FENNELLY [ tfennelly ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "PR 75 (Web Link)" [ 12142 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-26128 [ JENKINS-26128 ]
          Tom FENNELLY made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Jesse Glick made changes -
          Link New: This issue depends on JENKINS-28131 [ JENKINS-28131 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 161341 ] New: JNJira + In-Review [ 196723 ]
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]

            tfennelly Tom FENNELLY
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: