Agent Side Extensions
Last modified: 20 April 2023Currently, there are two ways to extend build agent:
Write a custom build runner
Write an extension to AntRunner (for instance, to process custom tasks)
Both approaches use similar way of plugin packaging and deployment (see below).
Descriptor
Plugin descriptor for the build agent plugins is named build-agent-plugin.xml
. A build agent reads its plugins using NanoContainer:
<container> <component class="jetbrains.buildServer.agent.nant.NAntBuildRunner"/> </container>
Package your build agent plugin as a zip archive with the following content:
<pluginName> <pluginName>/lib/ <pluginName>/lib/pluginJar1.jar <pluginName>/lib/pluginJar2.jar <pluginName>/otherDir/ <pluginName>/otherDir/someFile.txt
This archive will be unpackaged in the plugins
subdirectory during the build agent installation:
buildAgent/
buildAgent/bin/
buildAgent/lib/
buildAgent/plugins/<pluginName>/
buildAgent/plugins/<pluginName>/lib/
buildAgent/plugins/<pluginName>/otherDir/
Writing Ant Extension
Implement jetbrains.buildServer.agent.ant.AntTaskExtension interface and register it as a component in build-agent-plugin.xml
file.
Deployment
To deploy a build agent plugin:
Copy a build agent plugin's zip archive to the
/update/plugins
directory on the Team Server.Copy server part of the plugin into the
WEB-INF/lib
directory of the Tomcat server. If server part was modified, restart Tomcat server. Agents will download updated plugin automatically.
Thanks for your feedback!