“...the best thing since sliced bread when it comes to managing projects and their environments...” “...this is a very solid piece of software!” “...we implemented a *real* deployment process...” “...our confidence in the reliability and repeatability of the deployment process has been restored...” “BuildMaster is absolutely swell!” “...we can now react at the speed of business...” “BuildMaster made us re-think what proper deployment is...” “...extremely capable software, especially in an enterprise environment...” “...it's 2:45 AM your time?! Do you guys never sleep?” “BuildMaster is a great tool for automating the build process, but stands head and shoulders above other tools...” “...manual, error-prone deployments are a thing of the past...” “...BuildMaster makes sense of incremental builds and their very liquid feature sets...” “...all of my projects are building wonderfully and are fully integrated into deployment...”

BuildMaster Extensions

 
 
 
ExtensionPerforce
AuthorInedo
Tags[edit]
Current Release3.0

Please refer to the documentation for information about how to manually install an extension in BuildMaster.

Previous Releases

 
2.8 11/29/2011Download v2.8
2.6 10/10/2011Download v2.6

Perforce Extension

BuildMaster uses the Perforce Command-Line Client (p4, or p4.exe on Windows) for Perforce integration, and therefore the Command-Line Client must be installed on the same server that BuildMaster is installed on, or installed on a server that a BuildMaster agent is installed to. In either case (local or remote server), the setup is the same.

Configuring the Perforce Client on Your Server

There are two clients that are freely available from Perforce: P4 and P4V. The "V" in P4V stands for Visual, and contains both the P4 Command-Line Client and a graphical interface. The visual client is easier to work with, especially if you're not familiar with with all the various command-line options. We generally recommend installing P4V, even though BuildMaster will only use P4.

A connection to a Perforce Server requires four key pieces of data:

  • User Name ("P4USER") - the username to login into the Perforce Server
  • Password ("P4PASSWD") – the user's password
  • Workspace Name ("P4CLIENT") – the server-defined workspace to use
  • Perforce Server ("P4PORT") – the server and port number

Creating a Client Workspace

A Perforce client workspace is a set of files on a machine that mirror a subset of the files in the depot. Creating a client workspace is relatively simple from P4V, but it can also be accomplished with P4 with the following steps:

md c:\p4workspaces\user1_workspace1
cd c:\p4workspaces\user1_workspace1
p4 –u {username} –p {password} –P {server:port} client user1_workspace1

The P4 command will cause a text editor (default: notepad) to open, and once you close it the client workspace ("user1_workspace1") will be created. In future editions of the BuildMaster Perforce Extension, we may automatically create this for you, but for now, it requires a simple command.

Configuring Environment Variables (Optional)

Although it's easy to simply enter these four values in the BuildMaster source control provider, you can also define these through P4 environment variables. Environment variables are relatively easy to set-up and allow for even more fine-grained control of P4, but they're defined per-user, which means that you must configure them for the account that BuildMaster is running under.

For this setup, I have a Windows server called BMPERFORCESV2, which has the P4 client installed and a BuildMaster agent running under the BUILDMASTERUSER account. To configure the four P4 environment variables, I first logged-in to the server as BUILDMASTERUSER, opened up a command-line, and executed four commands:

p4 set P4USER=user1
p4 set P4PASSWD=password1
p4 set P4CLIENT=user1_workspace1
p4 set P4PORT=bmperforcesv1:1666

To verify this setup, execute two p4 commands ("set" and "depots"), which should return a list of the depots:

Perforce Depots

The list of depots shows that P4 was able to connect to the server successfully.

Configuring the BuildMaster Perforce Extension

The BuildMaster Perforce Extension works like most other source control extensions. First, you'll need to create a source control provider. To do this, go to Admin > Source Control > Add New Provider, and then select Perforce from the list.

Perforce Provider

After filling in the appropriate fields, a click of the "Test Connection" button should verify that Perforce is connected.

Perforce and BuildMaster

In addition to being able to browse your Perforce depots from within BuildMaster, there are three actions you can now use:

  • Get Latest
  • Get Labeled
  • Apply Label

See Label and Tag Your Builds in Source Control with BuildMaster for some best practices in chaining together these actions.

Continuous Integration

Like any other Source Control Provider in Buildmaster, you can also set-up a build schedule for continuous integration.

Perforce and Continuous Integration