The instructions on this page describe how to configure a Perforce source repository.

On this page:

Configuring a Perforce Source Repository

Navigate to the source repository settings for a Plan or Job, as described on Specifying the Source Repository for a Plan. Choose to add a new or edit an existing repository and select Perforce in the Source Control drop-down. 

PortType either the port to which the Perforce client will connect, or the Perforce server itself. This is the Perforce P4PORT environment variable that tells Bamboo which p4d (Perforce server) to use.
Client (Workspace) (3)The name of the Perforce Client Workspace which Bamboo will use. The Client Workspace determines which portions of the depot are visible in your Workspace Tree.
Do not create two Plans/Jobs that use the same client (e.g. one client set to manage, the other client set to not manage). This setup will create major issues in your builds.
Depot ViewThe client view of the depot that contains the source code files for this Plan/Job. This is typically in the form //<clientname>/<workspace_mapping>/... For details please see the Perforce User's Guide.

Bamboo sets the client root to its working directory, which means that code will be checked out to the 'working directory/<workspace_mapping>' location. Please take note of this, when specifying the 'Artifact Copy Pattern' for your Build Artifacts.)

UsernameThe Perforce username that Bamboo will use when it accesses the server ('Port'). Leave this field blank if you want Bamboo to use the default Perforce user (i.e. the OS username).
PasswordType the password required by the Perforce username (if applicable).
Let Bamboo manage your workspace (4)This field indicates whether or not you want Bamboo to manage your workspace.
Enable Quiet Period

Select this setting to set Quiet Period parameters for the Plan's build. Upon selecting this option, the following fields become available:

Quiet Period — This setting is used to avoid starting a build while someone is in mid-checkin. Bamboo will only initiate a build for this Plan when no more changes are detected within the Quiet Period following the last known change. Type the number of seconds Bamboo should wait.

Maximum Retries — You can specify how many times Bamboo should check for new changes using the Quiet Period parameter before initiating a build. For example, if you have set the Quiet Period to '10' seconds then Bamboo will check if a checkout has occurred in the last 10 seconds. If you have then specified Maximum Retries as '5', then Bamboo will perform this check five times before initiating the build, regardless of any activity during the Quiet Period of the last check.



Screenshot above: Source Repository — Perforce

Notes

  1. You will not be able to create Plans/Jobs that use a Perforce repository without specifying the shared local Perforce capability first. Read more about configuring a Perforce capability.
  2. Keep your Perforce configuration up to date — If you are using Perforce as your repository, you must ensure your Perforce configuration in Bamboo is in sync with any changes to your Perforce repository (such as client, depot or user credential changes). If not, your Perforce repository changes may cause unexpected behaviour in Bamboo when Bamboo tries to access the repository. See the notes in the configuration instructions below for further details.
  3. Issue when running Bamboo with Perforce prior to Bamboo 2.0.7 — A known issue exists when running Bamboo with Perforce prior to Bamboo 2.0.7 (See BAM-2866 and BAM-2849). If you change the name of your Perforce client (i.e. via an update) without updating your Perforce configuration in Bamboo, Bamboo will not be able to find the Perforce client to run against. Perforce will then create a default client in your running directory. This can lead to situations where Bamboo will attempt to clear out data from your running directory (e.g. force build). To avoid this problem, ensure that you update the 'Client' in your Perforce configuration whenever you change your Perforce client.
  4. Please be aware of the following implications when either letting Bamboo manage or preventing Bamboo from managing your workspace:
Related Topics

Specifying the Source Repository for a Plan
Specifying the Source Repository for a Job