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

Environment variable EXECUTOR_NUMBER should be usable inside node{} block

    Details

    • Similar Issues:

      Description

      Among few other environment variables that are generally available in freestyle job, EXECUTOR_NUMBER is not exposed in workflows.

      Referencing to the discussion in the attached URL, I would like to see this environment variable exposed especially inside node{} blocks where it makes the most sense. We have a similar use case as described in the discussion where workspaces are allocated based on the executor number, and currently workflow cannot handle this situation.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            CHANGES.md
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/EnvWorkflowTest.java
            cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/EnvActionImpl/Binder/help.jelly
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java
            http://jenkins-ci.org/commit/workflow-plugin/5bf78264c69dfb2b093fd08f382780f44a11bd68
            Log:
            Merge pull request #280 from bss/JENKINS-31391-Executor-number

            Add EXECUTOR_NUMBER to build env

            Compare: https://github.com/jenkinsci/workflow-plugin/compare/1d8a2a49a55b...5bf78264c69d

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md aggregator/src/test/java/org/jenkinsci/plugins/workflow/EnvWorkflowTest.java cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/EnvActionImpl/Binder/help.jelly support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java http://jenkins-ci.org/commit/workflow-plugin/5bf78264c69dfb2b093fd08f382780f44a11bd68 Log: Merge pull request #280 from bss/ JENKINS-31391 -Executor-number Add EXECUTOR_NUMBER to build env Compare: https://github.com/jenkinsci/workflow-plugin/compare/1d8a2a49a55b...5bf78264c69d
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java
            http://jenkins-ci.org/commit/workflow-plugin/8505f0f82596b249b6e8ea8a2957d67d3a487188
            Log:
            Removing TODO comment filed as JENKINS-31391.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java http://jenkins-ci.org/commit/workflow-plugin/8505f0f82596b249b6e8ea8a2957d67d3a487188 Log: Removing TODO comment filed as JENKINS-31391 .
            Hide
            jglick Jesse Glick added a comment -

            Preferably should introduce an API in CoreEnvironmentContributor to allow implementation to be shared.

            Show
            jglick Jesse Glick added a comment - Preferably should introduce an API in CoreEnvironmentContributor to allow implementation to be shared.
            Hide
            jglick Jesse Glick added a comment -

            NODE_LABELS is also missing.

            Show
            jglick Jesse Glick added a comment - NODE_LABELS is also missing.

              People

              • Assignee:
                vexdev Luca Vitucci
                Reporter:
                oltzu Olli Sivonen
              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: