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

customWorkspace setting of agent directive does not support EXECUTOR_NUMBER

XMLWordPrintable

      The default workspace has the executor number in the path, separated by '@' sign, for example c:\builds\jenkins-slave\workspace\test@2 when running on executor number 2.

      This causes some trouble with our build scripts, so we'd like to use a path without '@' sign, but including the executor number (in order to isolate the builds). However, using something like

      agent {
        node {
          label "my-agent"
          customWorkspace "C:\builds\jenkins-slave\workspace\${JOB_NAME}_${EXECUTOR_NUMBER}"
        }
      }

      in declarative pipeline does not work, it will issue a groovy.lang.MissingPropertyException: No such property: EXECUTOR_NUMBER.

      Why can't EXECUTOR_NUMBER be used here? Any other way how this could be achieved?

            Unassigned Unassigned
            chamshoff Christoph Amshoff
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: