Skip to main content
Version: 24.3

Using CommitStream with Perforce P4V

This article explains how to use CommitStream with Perforce P4V.

Overview

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

Prerequisites

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 Digital.ai Agility on-premise, your Digital.ai Agility instance must be able to communicate with the CommitStream host
  • If using a Microsoft Windows-based Perforce P4V server, Microsoft PowerShell version 4.0 or greater is required
  • If using a Linux-based Perforce P4V server, Bash version 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 Microsoft Windows and Linux based Perforce P4V servers.

  1. click the hamburger menu Hamburger iconAdmin, scroll down to the DevOps section, and click CommitStream.
  2. Click on the Perforce P4V VCS icon.
  3. Enter the location of the desired Perforce P4V server and click the "Add" button.
  4. Once the repository has been added, the Download link 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.
  5. 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".
  6. Open the commit-event file and replace the values for the Perforce P4V username and password. Note that these must be administrator credentials in order for the script to run properly.
  7. Configure the global trigger file to include this trigger. For the following example we will use a trigger with the following values:
Trigger Namecommitstream
Trigger Typechange-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".

  • Microsoft Windows
  • Open Microsoft 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:

    • 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:
    • Save the file

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