README.adoc
June 2, 2026 ยท View on GitHub
= Example plugin development with TeamCity Secondary Nodes :teamcity-version: 2026.1 :uri-teamcity: https://www.jetbrains.com/teamcity/[TeamCity] :uri-teamcity-docs: https://www.jetbrains.com/help/teamcity/{teamcity-version} :uri-multiple-nodes: {uri-teamcity-docs}/multinode-setup.html :uri-gradle-teamcity-plugin: https://github.com/rodm/gradle-teamcity-plugin :uri-environments-plugin: {uri-gradle-teamcity-plugin}/blob/main/README.adoc#teamcity-environments-plugin :uri-teamcity-nodes: http://localhost:8211/admin/admin.html?item=nodesConfiguration :uri-teamcity-plugins: http://localhost:8211/admin/admin.html?item=plugins
This project demonstrates how to build and test a TeamCity plugin with {uri-multiple-nodes}[multiple nodes] and how to extend the Gradle TeamCity {uri-environments-plugin}[Environments] plugin.
The project contains the following
build-logica project that implements a Gradle pluginteamcity-multinode-environmentsthat extends the {uri-gradle-teamcity-plugin}[Gradle TeamCity plugin] to add support to run multiple TeamCity nodes.multi-node-groovya project using the Groovy DSL that provides an example multi-node configuration using the Gradle plugin inbuild-logicto deploy the TeamCity plugin from theteamcity-pluginproject.multi-node-kotlina project using the Kotlin DSL that provides an example multi-node configuration using the Gradle plugin inbuild-logicto deploy the TeamCity plugin from theteamcity-pluginproject.teamcity-plugina project that implements a simple TeamCity plugin to be deployed to the multi node environment.
The example multi node environments in multi-node-groovy and multi-node-kotlin configure an environment using
TeamCity version {teamcity-version} with 2 nodes, node1 on port 8211 and node2 on port 8311 and a database.
The plugin supports the MySQL and PostgreSQL databases, they can be selected with the useMySQL and
usePostgreSQL functions.
The example environment can be seen in the following link:multi-node-groovy/build.gradle[Groovy] and
link:multi-node-kotlin/build.gradle.kts[Kotlin] build scripts.
The teamcity-multinode-environments plugin provides the following commands for each environment
-
deployTo<environment> -
undeployFrom<environment> -
create<environment>Databasea task to create the database to be used by the TeamCity nodes -
start<environment>Databasea task to start the database -
stop<environment>Databasea task to stop the database -
configure<environment>Databasea task to configure the TeamCity database properties file and deploy the JDBC driver -
start<environment><node>Servera task to start the TeamCity server node -
stop<environment><node>Servera task to stop the TeamCity server node -
start<environment>Agenta task to start the TeamCity Build Agent, the task requires the main server to be started -
stop<environment>Agenta task to stop the TeamCity Build Agent -
start<environment>a task to start the database, TeamCity Server nodes and Build Agent -
stop<environment>a task to stop the database, TeamCity Server nodes and Build Agent
The tasks to start and stop an environment are executed in order so that the database is started before the nodes and the build agent after the main node.
After starting the environment both nodes should appear in the {uri-teamcity-nodes}[Nodes Configuration] and the TeamCity plugin in {uri-teamcity-plugins}[Plugins].