Installing Agent Tools
In TeamCity an agent tool (i.e. a set of files/a binary distribution) is a type of plugin without any classes loaded into the runtime; agent tools are used to only distribute binary files to agents.
TeamCity allows you to install additional tools on all the agents, which is especially useful in the environments with a large number of build agents as you can distribute tools to or remove them from all build agents at once, centralize configuration files distribution (e.g. you want to distribute a custom configuration file/library to all agents), etc.
The structure of the tool plugin is described Plugins Packaging.
A tool to be distributed can be a separate folder or a .zip archive:
If you use a separate folder, TeamCity will use the folder name as the tool name on all agents.
If you use a zip file, TeamCity will use the name of the zip file as the tool name on all agents. The zip file will be automatically unpacked on the agents to the directory with the same name.
To distribute a set of files to all agents, perform the following:
Create the
.tools
directory underTEAMCITY_DATA_DIR/plugins
.Under the
.tools
directory, create a directory or a .zip file containing the files you want to distribute to all the agents.TeamCity monitors the content of this folder so the tool will be automatically distributed to all agents and the files will appear in the
TEAMCITY_DATA_DIR/tools
folder. No server restart is necessary. Agents will restart in the process of obtaining the tool.
You can see that the tool appears on the agent in the TeamCity Web UI by checking Predefined Build Parameters in the form teamcity.tool.<your tool name>
.
You can use this parameter in your build: reference this parameter in the TeamCity Web UI (anywhere where the %parameter% format is supported) or Defining and Using Build Parameters in Build Configuration.
To remove the previously installed tool from all agents, delete the .zip file or the folder with the tool from the <TeamCity Data Directory>/plugins/.tools directory. The tool will be removed from all agents.