Managing your Perforce Server with Codebeamer
After you have created your Perforce repository in Codebeamer you will see the Perforce changes/commits/diffs in Codebeamer immediately.
To have a better integration, you will need to instrument your Perforce server by installing a set of Perforce triggers to your server. These triggers are called ScmLoop and is provided as part of Codebeamer suite to make this integration possible.
By installing ScmLoop triggers you will get following features:
Codebeamer will control User Permissions: your Perforce server will accept submits only from users who has Permissions to commit, and these Permissions are configured and managed inside your Codebeamer installation.
Codebeamer will know when a Perforce commit happens, so any new Perforce changes in Codebeamer.
Codebeamer will automatically bind that appropriate Codebeamer Task to your Perforce commits. See: Tracing Source Code Changes to Requirements, Task and Bugs
Codebeamer can force Perforce to accept only those commits which has a valid Codebeamer Task associated to. This needs that "Commits/push only with valid Codebeamer Item IDs" option is turned on.
Codebeamer will send notification email about the new Perforce submits to the appropriate Codebeamer users. See: Tracking Source Code Changes and Developer Team Activity through Commit Notification Emails
Installing ScmLoop: the Perforce triggers
Installing ScmLoop - the Codebeamer integration- means that you install the ScmLoop as triggers on your Perforce server. For more information see: Perforce documentation about Triggers
Important: because Perforce server executes triggers as a specific OS user you will need to be sure that all executables mentioned here is on the PATH of this user, and the ScmLoop installation directory is accessible/executable/writable by this OS user!
Prerequisites:
Install Java openjdk 1.8 and put on PATH.
Install Apache Ant and put on PATH.
Install Perforce client executable and put on the PATH.
Next: Pick a directory where the ScmLoop will be installed . This directory must be accessible and writable by the Perforce user of your OS which executes the triggers. For example use a directory like: /opt/scmloop/.
You can find the scmloop.zip file inside your Codebeamer installation directory as $CB_HOME/tomcat/webapps/cb/scmloop.zip. Copy this file to the Perforce server to the scmloop directory (like /opt/scmloop) and unzip it here.
The "scmloop" or "scmloop.bat" (depending your OS) is the main executable. Edit this, and update these lines:
The CB_BASE_URL variable must contain the HTTP url of your Codebeamer installation, the SCM_DIR must contain the current directory where ScmLoop is installed.
Binding ALL Perforce Depots to Codebeamer's Perforce repositories
After the previous steps ScmLoop is installed on your Perforce host, but no Perforce triggers has been installed yet.
So to get the correct Perforce > codebeamer integration you will need to install the Perforce triggers for ALL the Perforce Depots you want to manage in Codebeamer. So if you have 10 Depots in Perforce and want to integrate all with Codebeamer then create 10 appropriate repositories in Codebeamer and bind each Depot to Codebeamer as described below.
So to install the ScmLoop trigger go to the ScmLoop installation directory and there you will find a "perforce" directory and an install_triggers.xml Ant script here:
...SCM_DIR...
├── cb-commitclient.txt
├── perforce
│ ├── install_triggers.xml
│ ├── triggers-original.txt
│ ├── triggers.txt
│ ├── unix
│ │ ├── change-commit
│ │ └── change-content
│ └── windows
│ ├── change-commit.bat
│ └── change-content.bat
├── scmloop
├── scmloop.bat
Install the triggers by executing this command in $SCM_DIR/perforce directory.
Important: before executing the script ensure that you are logged in to Perforce using a p4 login command using an Perforce user-account which has necessary privileges to install triggers!
ant -f install_triggers.xml
This script will ask about:
The id number of the Codebeamer repository to bind the Depot to. You can find this on the Codebeamer UI:
The Depot's path like "//depot"
The Perforce user and password: the trigger needs a Perforce user and password to get the information necessary from your Perforce server.
Enter these, and the script will install the Perforce triggers. A sample output looks like:
The installation for this Depot is completed: the necessary Perforce triggers are added - can be verified using p4 triggers command.
* 
Don't forget Repeat these for every Depot and install the necessary triggers for all of them!
Troubleshooting Perforce triggers
When Perforce triggers does not work then:
Check the log file: cb-commitclient.txt
Check that the Perforce trigger user can read/write/execute the files in the ScmLoop directory
Check that all your Depots are configured to the appropriate Codebeamer repository!
Permissions: who can submit a change?
After the ScmLoop triggers are installed into Perforce server then Codebeamer will allow only those submits by Perforce users who has appropriate Permissions to submit changes in Codebeamer.
What happens here is:
Perforce user submits a change using the usual Perforce clients ("p4 submit" command for example or the native UI clients")
ScmLoop trigger communicates with Codebeamer:
Codebeamer figures out who is the "Codebeamer account" for the "Perforce submitter", and checks if this Codebeamer account has permission to submit
Codebeamer allows the submit only if the Perforce user has appropriate permissions
Perforce client accepts the change or shows the appropriate error message
Was this helpful?