JetBrains TeamCity plugin

4 minute readExtensibilityDeveloper productivity

JetBrains TeamCity is a user-friendly continuous integration (CI) server for developers and build engineers. Use the TeamCity plugin to interact with the TeamCity Server to perform tasks such as managing agents, pools and running builds.

Plugin Version 2.0.2.2020102201
Revised on November 1, 2020

Supported versions

This plugin was developed and tested with TeamCity 10.

Create TeamCity plugin configurations

Plugin configurations are sets of parameters that can be applied across some, or all, plugin procedures. They can reduce the repetition of common values, create predefined parameter sets, and securely store credentials. Each configuration is given a unique name that is entered in the designated parameter for the plugin procedures that use them. The following steps illustrate how to create a plugin configuration that can be used by one or more plugin procedures.

To create a plugin configuration:

  1. Navigate to DevOps Essentials  Plugin Management  Plugin configurations.

  2. Select Add plugin configuration to create a new configuration.

  3. In the New Configuration window, specify a Name for the configuration.

  4. Select the Project that the configuration belongs to.

  5. Optionally, add a Description for the configuration.

  6. Select the appropriate Plugin for the configuration.

  7. Configure the plugin configuration parameters.

  8. Select OK.

TeamCity plugin configuration parameters

Table 1. EC-TeamCity plugin configuration parameters
Parameter Description

Configuration Name

Provide a unique name for the connection.

Hostname

Host name of the TeamCity server.

Port

Port used by the TeamCity server.

Protocol

Protocol used by the TeamCity server.

Login As

TeamCity account username/password. For guest access, use the guest username and an empty password.

Create TeamCity plugin procedures

Plugin procedures can be used in procedure steps, process steps, and pipeline tasks, allowing you to orchestrate third-party tools at the appropriate time in your component, application process, or pipeline.

Get agents

Retrieves a list of TeamCity build agents.

Input parameters

Table 2. Get agents parameters
Parameter Description

Configuration name

The name of the saved configuration for accessing the TeamCity server.

Enable agent

Enables or disables the build agent.

Input parameters

Table 3. Enable agent parameters
Parameter Description

Configuration Name

The name of the saved configuration for accessing the TeamCity server.

Agent ID

Build agent identifier, for setting the enabled state.

Enable

Enabled state for the build agent.

Comment

Optional comment on build agent status change.

Authorize agent

Sets the authorization status for the build agent.

Input parameters

Table 4. Authorize agent parameters
Parameter Description

Configuration Name

The name of the saved configuration for accessing the TeamCity server.

Agent ID

Build agent identifier for setting the authorization state.

Authorize

The authorization status for the build agent.

Assign agent to pool

Assigns the build agent to a pool.

Input parameters

Table 5. Assign agent to pool parameters
Parameter Description

Configuration Name

The name of the saved configuration for accessing the TeamCity server.

Agent ID

Build agent identifier for setting the authorization state.

Pool ID

Pool identifier for build agent assignment.

Get pools

Retrieves a list of agent pools.

Input parameters

Table 6. Get pools parameters
Parameter Description

Configuration name

The name of the saved configuration for accessing the TeamCity server.

Get build types

Get the list of build configurations.

Input parameters

Table 7. Get build types parameters
Parameter Description

Configuration name

The name of the saved configuration for accessing the TeamCity server.

Build

Runs the build task.

Input parameters

Table 8. Build parameters
Parameter Description

Configuration Name

The name of the saved configuration for accessing the TeamCity server.

TeamCity Build ID

The build task identifier to be launched.

Parameters

The additional parameters for the build. Each parameter must be on a new line in the following format: "key=value".

Property for resulting internal build ID

Property name used to store the resulting internal build ID.

Import build artifact

Imports build artifact from TeamCity to the CloudBees CD/RO repository.

Input parameters

Table 9. Import build artifact parameters
Parameter Description

Configuration Name

The name of the saved configuration for accessing the TeamCity server.

Internal Build ID

The internal build identifier for the successfully completed build.

Repository Name

The name of the repository where the artifact is published.

Artifact Group

The artifact group for the published build artifact.

Artifact Key

The artifact key for the published build artifact.

Artifact Version

The artifact version for the published build artifact.

Get build log

Retrieves a log of the completed build.

Input parameters

Table 10. Get build log parameters
Parameter Description

Configuration name

The name of the saved configuration for accessing the TeamCity server.

Internal build ID

The internal build identifier for the completed build to retrieve the log file from.

Release notes

3.0.0

  • Upgraded from Perl 5.8 to Perl 5.32. The plugin is not backward compatible with CloudBees CD/RO versions prior to 10.3. Starting from this release, a new agent is required to run EC-TeamCity plugin procedures.

2.0.2

  • The documentation has been migrated to the main documentation site.

2.0.1

  • Added support for CSRF protection.

  • The Build plugin procedure now saves the following additional build properties: buildUrl, buildStatus, and buildState.

  • Upgraded plugin configuration management.

2.0.0

  • The plugin icon has been updated.

1.2.10

  • Added the ability to specify additional parameters for the build.

1.2.9

  • Added the option to sign in to the TeamCity server with guest access.

  • Added HTTP/HTTPS protocol selection for access to the TeamCity server.

1.2.8

  • Fixed an error in the name of the procedure parameters.

  • Added support for the Get Build Log procedure.

  • The Build now procedure returns the build identifier, regardless of the status of the completed task.

1.2.7

  • Fixed the procedure definition in the CloudBees CD/RO pipeline interface.

  • Added default settings for Build and Import Build Artifact procedures.

  • Corrected labels for the parameters of procedures.

1.2.6

  • Added support for the Import Build Artifact procedure.

  • The Build procedure now stores the internal build identifier to the job property.

1.2.5

  • Added plugin documentation.

1.2.4

  • Fixed a typo in the Build procedure.

  • Performed minor code refactoring.

1.2.3

  • Minor fixes.

1.2.2

  • Changed the procedure names in the step picker section.

1.2.1

  • Upgraded the plugin to use the new XML parameter form.

1.2.0

  • Added support for the Build procedure.

  • Added support for the Get Build Types procedure.

1.1.0

  • Added support for the Get Agents procedure.

  • Added support for the Get Pools procedure.

1.0.0

  • Initial version.