Jenkins Help

Back to index
Note
This page is generated from Jenkins inline help intended to be rendered within the Jenkins UI. Some minor content glitches are expected.

An agent needs to have a directory dedicated to Jenkins. Specify the path to this directory on the agent. It is best to use an absolute path, such as /var/jenkins or c:\jenkins. This should be a path local to the agent machine. There is no need for this path to be visible from the master.

Agents do not maintain important data; all job configurations, build logs and artifacts are stored on the master, so it would be possible to use a temporary directory as the agent root directory.
However, by giving an agent a directory that is not deleted after a machine reboot, for example, the agent can cache data such as tool installations, or build workspaces. This prevents unnecessary downloading of tools, or checking out source code again when builds start to run on this agent again after a reboot.

If you use a relative path, such as ./jenkins-agent, the path will be relative to the working directory provided by the Launch method.

  • For launchers where Jenkins controls starting the agent process, such as SSH, the current working directory will typically be consistent, e.g. the user's home directory.
  • For launchers where Jenkins has no control over starting the agent process, such as inbound agents launched from the command line, the current working directory may change between launches of the agent and use of a relative path may prove problematic.
    The principal issue encountered when using relative paths with inbound launchers is the proliferation of stale workspaces and tool installation on the agent machine. This can cause disk space issues.