TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Typical Plugins

Last modified: 20 April 2023

In this section:

Custom build number



Custom VCS



See jetbrains.buildServer.vcs.VcsManager.

If custom VCS plugin requires some settings to be edited from the web UI, then it should also provide a JSP file for its settings. This JSP file should be placed into the plugin jar under the buildServerResources/ path. In the buildServerSpring.xml you should also configure webResourcesUnpacker (note that you should use your vcs name as a plugin name), see above.

In the JSP file you should use special custom tags for input fields, radio buttons and checkboxes that correspond to your VCS properties. These custom tags are located in the props tag library:

<%@ taglib prefix="props" tagdir="/WEB-INF/tags/props" %>

You can use JSP files of existing VCS plugins as an example.

Custom Notifiers



See some docs at http://code.google.com/p/buildbunny/wiki/CreateTeamcityNotifier

Custom template processing: http://www.intellij.net/forums/thread.jspa?messageID=5187731

Build Result Tabs



Create subclass of ViewLogTab and attach it to the web place: WebControllerManager.addPageExtension(WebPlace.VIEW_LOG_TAB, this)

Custom User Authentication



Custom authentication API is based on Sun JAAS API. To provide your own authentication scheme, you should provide a login module class which must implement interface javax.security.auth.spi.LoginModule and register it in the jetbrains.buildServer.serverSide.auth.LoginConfiguration.

For example:

Now we should register this module in the server. To do so, we create a login module descriptor:

Finally we should create build-server-plugin-ourUserAuth.xml as it is described above and write there CustomLoginModuleDescriptor bean:

Create a jar, put it into the WEB-INF/lib directory of the TeamCity server and restart it. When the server is started, you should be able to choose your custom plugin from the drop down list of the Administration-> Server Configuration page.

Writing a Custom Build Runner



Agent-side Part



Implement jetbrains.buildServer.agent.BuildRunner interface (you may also extend GenericProgramRunner or even JavaProgramRunner helpers for this). To log your messages, you may obtain instance of ServerLogger singleton (you may also use ServerLoggerFacade for convinience).

TBD

Server-side Part



Build agent plugin should also provide server side jar with a class implementing jetbrains.buildServer.serverSide.RunType interface. The implementation of the RunType interface must be registered in the jetbrains.buildServer.serverSide.RunTypeRegistry. You can do this in the constructor of the RunType implementation, like this: