Skip to main content
System StatusContact Support
VersionOne Community

Using CommitStream with Perforce P4V

This feature is available in Catalyst, Enterprise, and Ultimate editions.

editions-ceu.png

Overview

Learn how to integrate CommitStream with your Perforce P4V version control system.

Pre-Requisites

The following must be considered In order for CommitStream to function properly when using Perforce P4V

  • Your Perforce P4V server must be able to communicate with the CommitStream host (https://commitstream.v1host.com)

  • If using VersionOne Lifecycle on-premise, your Lifecycle instance must be able to communicate with the CommitStream host 

  • If using a Windows-based Perforce P4V server, Powershell ver 4.0 or greater is required

  • If using a Linux-based Perforce P4V server, Bash ver 4.0 or greater is required

  • Only forward slash (/) notation should be use for repository location

  • In order to follow CommitStream links for commits or repositories, a viewer such as Helix Swarm must be installed separately.

  • Note: post-commit script files are supported at the depot level only. Script files to be used with triggers must be placed at the top level depot folder of your Perforce server.

Configuring Perforce P4V

The following steps can be used for both Windows and Linux based Perforce P4V servers.

  1. Go to Admin > DevOps CommitStream.

  2. Click on the Perforce P4V VCS icon.

  1. Enter the location of the desired Perforce P4V server and lick the "Add" button.

  1. Once the repository has been added, the "Download" area on the right hand side will offer the "commit-event" file download. Download the file for the OS family being used on your Perforce P4V server.

  1. Once the download is complete, take the "commit-event" file ("commit-event.ps1" for windows or "commit-event.sh" for Linux) and place it in the Perforce folder that corresponds to your repository. This would be the specific top-level "depot".

Please note: the script file must be placed at the top level "depot" folder in order to the post-commit trigger to work properly.

  1. Open the commit-event file and replace the values for the P4V username and password. Note that these must be administrator credentials in order for the script to run properly.

Windows: 

Line 8 | p4AdminUser="AdminUserNameHere"
Line 9 | p4AdminPass="AdminPasswordHere"

Linux

Line 11 | p4AdminUser="AdminUserNameHere"
Line 12 | p4AdminPass="AdminPasswordHere"
  1. Configure the global trigger file to include this trigger. For the following example we will use a trigger with the following values:
Trigger Name commitstream
Trigger Type change-commit
Repository Location //MyRepository/...
Script Location "/home/user/Perforce/MyRepository/commit-event.sh %change% %user% %client% %serverport%"

Keep in mind that you can use a different trigger name if you already have a convention implemented. Additionally, repositories are commonly addressed in Perforce as "depots". 

  • Windows
    • Open powershell as administrator
    • Login to Perforce by typing p4 login
    • Enter Perforce's administrator password
    • Open global trigger file by typing p4 triggers
    • Once the file is open, add the parameters in the above table under the "triggers" section as follows:
    • commitstream change-commit //MyRepository/... "powershell -ExecutionPolicy bypass -File C:/home/user/Perforce/MyRepository/commit-event.ps1 %change% %user% %client% %serverport%"
      
    • Save the file
  • Linux
    • Ensure the Perforce service is running on the server
    • Navigate to the location where Perforce is installed (top-level directory)
    • Login to Perforce by typing p4 login
    • Open the global trigger file by typing p4 triggers
    • Once the file is open, add the parameters in the above table under the "triggers" section as follows:
    • commitstream change-commit //MyRepository/... "/bin/bash /home/user/Perforce/MyRepository/ commit-event.sh %change% %user% %client% %serverport%
      
    • Save the file

After this setup is done, CommitStream will receive the commit data from your Perforce P4V repo and display it in VersionOne Lifecycle.

  • Was this article helpful?