Plugin for TeamCity
Integrate TeamCity with Unity Version Control for your CI/CD pipeline.
Read time 6 minutesLast updated 21 days ago
Installation
The Unity Version Control (UVCS) plugin for TeamCity extends the capabilities of the TeamCity server, enabling it to manage continuous integration operations using source data that is under UVCS control. To install the UVCS plugin for TeamCity:- Open "Plugins list" from TeamCity's Administration menu.
-
Click the "Upload plugin zip" link.

Changing the user identity
- Upload the UVCS plugin for TeamCity:
<UVCS installation directory>/client/plugins/teamcity/com.codicesoftware.plugins.teamcity.PlasticSCM.zip
- Restart TeamCity Server. This way, the plugin will be automatically unpacked and loaded.
-
(Windows systems only) The plug-in runs UVCS commands with the user identity of the TeamCity Build Agent Service (Agent-side checkout mode). By default, this identity is the SYSTEM user account. We recommend changing this service's user account to a different one:
- Go to Control Panel > Administrative Tools > Services.
- Right-click TeamCity Build Agent Service and select Properties.
-
Go to the "Log On" tab and select another user who already has a valid UVCS configuration.

Changing the user identity
- Start the TeamCity Server service.
Configuration
Create a new Project in TeamCity
First step is creating a new Project in TeamCity, which will be attached to UVCS later. To do that, Go to "Administration" > "Projects" and click on "Create new Project" button.
Changing the user identity
Create a build Configuration
After creating the Project, TeamCity wizard asks for a Build Configuration. Again, enter a valid name, ID and description and click "Create" button.
Changing the user identity
Configure VCS Root using TeamCity UI
This is the wizard step where we attach our Project to UVCS. Select "Plastic SCM" as a type of VCS, enter a VCS root name and ID, required by TeamCity. The specific fields for UVCS plugin are the following:- Server: location of UVCS server (IP / name:port).
- Repository: the UVCS repository to download contents for the build Project.
- Branch: the default branch on the specified repository to track changes and build them (/main branch by default).
- Branch specification (optional): TeamCity opens the possibility to track other branches' changes different than configured default branch, by entering inclusion / exclusion rules.

Changing the user identity

Changing the user identity
Configure VCS Root using Kotlin DSL
When using the TeamCity Kotlin DSL to configure your project's VCS Root, you can define parameters to customize the behavior of the UVCS integration. Below is a detailed explanation of the parameters you can use, along with an example configuration.Supported Parameters
The following parameters are available for configuring VCS Roots:Parameter name | Description | Example value |
|---|---|---|
| Type of the VCS Root. | |
| Human-readable name for the VCS Root. | |
| UVCS server to connect to. | |
| Repository name within the UVCS server. | |
| Default branch to watch. | |
| Branches to monitor besides the default one. | |
| Enables or disables PlasticSCM branch filtering. | |
| Branch filter query. | |
| Attribute to mark branches as failed. | |
| Attribute to mark branches as succeeded. | |
| Attribute to mark branches as merged. | |
Example Configuration
Below is an example of configuring a VCS Root in Kotlin DSL, utilizing the parameters for branch filtering:// settings.ktsobject MyProject : VcsRoot({ type = "PlasticSCM" name = "My Project VCS Root" param("server", "organization@cloud") param("repository", "Awesome Project") // Enable Plastic branch filtering param("enable-plastic-branch-filtering", "true") // Define the branch filter query param("plastic-branch-filter", "status=resolved") // Define branch attributes for filtering param("plastic-branch-filter-attr-failed", "status=failed") param("plastic-branch-filter-attr-succeed", "status=tested") param("plastic-branch-filter-attr-merged", "status=merged")})
Parameter Details
type"PlasticSCM"nameserverrepositorybranch/mainteamcity:branchSpec+:branch-name-:branch-name*+:/main/*/main-:/main/Release*/mainenable-plastic-branch-filteringplastic-branch-filterplastic-branch-filterplastic-branch-filter-attr-failedplastic-branch-filter-attr-succeedplastic-branch-filter-attr-mergedConfigure checkout from VCS mode
TeamCity supports two different VCS checkout modes to download the contents to be built from UVCS (plus the option to do not perform the VCS checkout automatically, and usually delegating this action to the project's "Build Steps" configuration phase by executing an user-defined script). We highly recommend the "Agent-Side checkout mode", already supported by UVCS TeamCity plugin:
Changing the user identity
Configure build steps
This configuration depends on each specific project in order to trigger a build once the source code at a required version is downloaded.
Changing the user identity
Configure build trigger
This is the step that rules the way builds are triggered. In this example, we configure a VCS trigger so that builds are launched when TeamCity Server detects new changes in the tracked branches of the specified UVCS repository configured in the previous step: "Configure VCS root for the Project".
Changing the user identity
A basic build cycle tracking changes from UVCS repo
TeamCity is now ready to track changes from the configured feature branches in a repository. Let's see how TeamCity starts triggering builds when VCS changes are detected through a basic development cycle as an example with an existing repo in a UVCS server. First of all, a developer submits (checks-in in UVCS jargon) new changes in the default tracked branch (in this case, /main branch). A couple of seconds later, TeamCity detects these new changes, checkouts source code from /main branch into the configured workspace folder (from "checkout options" step while configuring the VCS root of the TeamCity project), and starts executing the actions defined in "Build Steps" in order to perform a build:
Changing the user identity
jesus
Changing the user identity

Changing the user identity

Changing the user identity

Changing the user identity