Setting Up Perforce Integration

Like CVS, Perforce runs on a variety of servers. Thus, FogBugz supplies both Perl and VBScript integration scripts for Perforce as well:

Program Files\FogBugz\Accessories\SourceControl\Perforce\logBugDataP4.pl Program Files\FogBugz\Accessories\SourceControl\Perforce\logBugDataP4.vbs

Follow these directions to set up FogBugz integration with Perforce: 1. Copy the appropriate script file into the Perforce installation directory.

2. Edit the script file, customizing it for your own FogBugz installation:

• Set the value of $BUGZ_SERVER to the DNS name of the Web server running FogBugz, for example, www.example.com.

• Set the value of $BUGZ_URL to the virtual path of your FogBugz installation. Normally this is /FogBugz/.

• If you're using Perfoce passwords, add code at the end of the customization section. For Perl, add these lines of code:

$UserName = $ARGV[3]; $Password = $ARGV[4]; $ClientHost = $ARGV[5];

$p4 = "p4 -p $ServerPort -c $ClientName -u $UserName -p $Password";

• If you're using the VBScript integration script, add these lines instead:

Dim UserName: UserName = args(3) Dim Password: Password = args(4) Dim ClientHost: ClientHost = args(5)

Dim p4: p4 = "p4 -p " & ServerPort & " -c " & ClientName & _ " -u " & UserName & " -p " & Password"

3. Add a trigger by typing p4 triggers at the command prompt. A text file appears. (If it doesn't, make sure p4, the Perforce executable, is in your path.) Add a line to the end of this file. (Note: if you have Perforce passwords enabled, add %password% after %user% in the trigger.) For the Perl version, the line to add is exTest //... "c::/perl/bin/perl.exe c:/path/logBugDataP4.pl %changelist% %serverport% %client% %user% %clienthost%"

For the VBscript version, use this line instead:

exTest //... "cscript.exe c:/path/logBugDataP4.vbs %changelist% %serverport% %client% %user% %clienthost%"

Make sure to enter this code on a single line in the file, and to precede it with a single tab character.

4. Save the file to create the appropriate trigger.

To set up integration in the reverse direction so that FogBugz can display code from your Perforce repository, follow these steps:

1. Download and install the perfbrowse project from http://www.perforce.com/perforce/ loadsupp.html to implement a Web interface to your Perforce repository.

2. Log in to FogBugz as an administrator. Click the Site hyperlink on the administration toolbar. Scroll down to find the Source Code Control URL settings.

3. Follow the instructions on screen to set up the proper URLs for calling perfbrowse.

4. Click OK to save your settings.

0 0

Post a comment