This is a rework of and extention to the AutoAuth plugin.
A TeamCity server plugin to automatically manager build agents on events captured by the server. This plugin helps automating the life cycle of build agents in the infrastructure, eliminating the need to manually authorize, unauthorize, and/or cleanup build agents. An appealing use case for this life cycle management would be the use of Cloud Profiles for automatically scaling agent pools based on workload.
NOTE: This plugin eliminates the need for manually authorizing, unauthorizing, and cleaning up TeamCity agents with the server, hence, it is important that this configuration is only used with a TeamCity server that is only exposed to trusted environments and agents.
All distributions of this plugin can be found on the JetBrain's Plugin portal.
Run ant dist
to create a dist for using with a TeamCity server distribution. Requires teamcity.distribution
and teamcity.data.directory
path variables.
The following parameters can be used in the build agent configuration to test the functionality with the server:
autoAuthorize=true
for authorizing and unauthorizing agents on registration and unregistration events.autoManage=true
for cleaning up agents in addition to authorization and unauthorization.
In a testing environment:
- Upload
AgentAutoAddRemove.zip
to the TeamCity server plugin directory (or from the UI atAdministration
→Plugins List
). - Reload or restart the TeamCity server.
- Add the right agent parameter to the configuration in
$agentDir/conf/buildAgent.properties
. - Start the build agent.
- On registration with the server, the agent is authorized.
- On unregistration with the server, the agent is unauthorized or removed from the agent list.