-
Bug
-
Resolution: Not A Defect
-
Major
-
None
-
Windows 2019 Server
We are in the process of migrating our Jenkins agents to new servers. In order to reduce path-too-long exceptions, we're using a different directory for the Jenkins home directory on the agents than on the server. The server uses D:\Jenkins_Home. The agents use D:\J . However, when Jenkins starts child build processes (specifically PowerShell), it sets the JENKINS_HOME environment variable to the path of the Jenkins home on the server/controller, not what's configured as the home directory on the node/agent configuration page.
Steps to reproduce:
- Add a Jenkins node/agent to Jenkins. Set its home ("remote root directory") directory to be a different path than the server/controller's home directory.
- Run a build with a PowerShell step that just outputs the environment variables, e.g. dir env:.
- Note that the JENKINS_HOME environment variable is set to the controller's Jenkins home directory, not the one configured for the agent.
I would expect that the JENKINS_HOME environment variable get set to the home directory for each agent.