-
Bug
-
Resolution: Fixed
-
Critical
-
None
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?