TeamCity 4.0 Help

Extensions

Extension in TeamCity is a point where standard TeamCity behavior can be changed. There are three marker interfaces for TeamCity extensions:

  • jetbrains.buildServer.serverSide.ServerExtension4.5.1

  • jetbrains.buildServer.agent.AgentExtension4.5.1

  • jetbrains.buildServer.TeamCityExtension4.5.1

Extension interface implements one of these marker interfaces. ServerExtension and AgentExtension are used to mark server and agent side extensions correspondingly. TeamCityExtension is the base interface for ServerExtension and AgentExtension. Thus you can take a list of all available extensions in TeamCity by taking a look at interfaces which extend these marker interfaces.

Registering custom extension

There are two ways to register custom extension:

  1. define a bean in the Spring context which implements extension interface, in this case your extension will be loaded automatically

  2. register your extension at runtime in the jetbrains.buildServer.ExtensionHolder4.5.1 service (can be obtained by Spring autowiring feature)

Some Useful Extensions

  • jetbrains.buildServer.serverSide.TextStatusBuilder4.5.1 - with help of this extension build status text shown in TeamCity UI can be modified.

  • jetbrains.buildServer.serverSide.TriggeredByProcessor4.5.1 - similar to TextStatusBuilder but affects "Triggered by" value shown in the UI.

  • jetbrains.buildServer.serverSide.FailedTestOutputFormatter4.5.1 - this extension allows to apply custom formatting to test stacktrace to be shown in the UI.

  • jetbrains.buildServer.serverSide.ParametersPreprocessor4.5.1 - allows to modify build parameters right before they are sent to an agent.

  • jetbrains.buildServer.serverSide.parameters.BuildParameterReferencesProvider4.5.1 - since TeamCity 4.5 allows to add Predefined Properties.

  • jetbrains.buildServer.serverSide.buildDistribution.StartBuildPrecondition4.5.1 - since TeamCity 4.5 allows to define preconditions for build starting on an agent, i.e. you can instruct TeamCity to delay build till some condition is met.

  • jetbrains.buildServer.serverSide.GeneralDataCleaner4.5.1 - this extension is called when cleanup process is going to finish, plugins can clean their data with help of this extension.

  • jetbrains.buildServer.serverSide.DataCleaner4.5.1 - this extension is called when cleanup process is going to clean up data of a build, plugins can remove their data associated with this build with help of this extension.

Last modified: 20 April 2023