Perforce

Last modified: 20 April 2023

This page contains descriptions of the fields and options available when setting up VCS roots using Perforce. Common VCS Root properties are described here.

P4 Connection Settings



Checkout On Agent Settings



When the agent-side checkout is used, TeamCity creates a Perforce workspace for each checkout directory/VCS root. These workspaces are automatically created when necessary and are automatically deleted after some idle time. It is possible to customize the name generated by TeamCity: add the teamcity.perforce.workspace.prefix configuration parameter at the Configuring Build Parameters page with the prefix in the value.

Perforce Workspace Parameters



With checkout on agent, TeamCity provides environment variables describing the Perforce workspace created during the checkout process. If several Perforce VCS Roots are used for the checkout, the variables are created for the first VCS root. The variables are:

  • P4USER - same as vcsroot.<VCS root ID>.user parameter

  • P4PORT - same as vcsroot.<VCS root ID>.port parameter

  • P4CLIENT - name of the generated P4 workspace on the agent

These variables can be used to perform custom p4 commands after the checkout.

Perforce Proxy Settings



To allow using Perforce proxy with the agent-side checkout, specify the env.TEAMCITY_P4PORT environment variable on the build agent and the agent will take this value as the P4PORT value.

Other Settings



Compatibility issues