SCMLoop - Connect External Repositories
This document describes how to install the Codebeamer SCMLoop component. Codebeamer has built in support for so called Managed Repositories. Managed Repositories are SCM repositories created and maintained by Codebeamer itself so you do not have to read this document.
SCMLoop is a notification mechanism, which allows associating commits to a Source Code Management (SCM) repository with Work Items in Codebeamer.
Currently, SCMLoop is available for the following SCM systems:
• Git (only on Linux/Unix)
• Subversion
• Mercurial (Hg)
• Perforce
An exclusive feature of Managed (Git, Mercurial and Subversion) Repositories is the seamless integration to create and administrate (including access control) of repository with Codebeamer.
You only need to setup the extra SCMLoop component manually if you want to connect already existing (external) Subversion, Git, Mercurial to Codebeamer not running on Codebeamer server to for example associate SCM changesets (commits) to Codebeamer Work Items.
Installing SCMLoop
You need to install the SCMLoop component on every server that hosts SCM repositories you want to connect.
Unpack the SCMLoop distribution archive from CB/tomcat/webapps/cb/scmloop.zip to a publicly accessible directory/folder. Either on each server that hosts SCM repositories, or on a network folder that is accessible from each SCM host.
The JRE version is identical with the Codebeamer version where the SCMLoop distribution originates from.
In order for SCMLoop to work, its configuration must be adjusted to the current environment.
On Windows systems you have to edit the script scmloop/scmloop.bat, on Unix systems scmloop/scmloop, and modify the values of the following variables:
Variable | Description |
SCM_DIR | The path to the scmloop[ .bat] script itself. |
CB_BASE_URL | The base URL of the Codebeamer web application. For example: http://localhost:8080/cb. |
JAVA | It must point to the java executable of the JRE to use. |
SCM_TOKEN | Since Codebeamer release 2.0.0.1. The SCMLoop token has been introduced to prevent unauthorized calls towards the Codebeamer SCM repositories. The token can be found • In the Application Configuration, under the "scc" node: "scc" : { "scmLoop" : { "token" : "CB-ENCRYPTED-**-**-**" } In the Application Configuration, the token is automatically generated and encrypted. If you delete the token and click Save, the token is automatically regenerated. If you add a new, decrypted token and click Save, Codebeamer saves and automatically encrypts the new token. • In the CB/repository/scmloop/scmloop file of the locally installed Codebeamer instance where the decrypted token is stored. | If the SCMLoop token is changed in the Application Configuration, the change is also saved in the CB/repository/scmloop/scmloop file. However, modifying the token in the local scmloop file does not update the token in the Application Configuration. The SCMLoop tokens must match in the Application Configuration and in the local scmloop file. Codebeamer displays an error message if calls are pushed without a proper SCMLoop token. |
If only internal repositories are used, no token management is required from the user. Codebeamer automatically generates the token during the first installation, and automatically edits the SCMLoop script. The token generation and the editing of the SCMLoop script are also performed when upgrading Codebeamer. If you use external SCMLoop installations, 1. You must overwrite the token at least once in the application_configuration. 2. Store the unencrypted form of the token. 3. Set the SCM_LOOP environment variable to the unencrypted form of the token in the shell script of the external SCMLoop installation. When upgrading Codebeamer, the existing external SCMLoop installations must be updated as the old clients cannot send the token. |
Make sure, that all SCM users are allowed to access and execute the scmloop[ .bat] script. On Linux/Unix systems it must be ensured (For example: . using command chmod) that the script scmloop is executable.
After you have successfully installed and configured SCMLoop, you can now start to instrument your SCM repositories.
Installation for Mercurial
Install Mercurial 1.8 or later (
http://mercurial.selenic.com/wiki/Download) and add
hg to the
PATH. On Windows use:
setx PATH %PATH%;MERCURIAL_HOME.
On linux use export PATH=$PATH:MERCURIAL_HOME where MERCURIAL_HOME is the directory where you installed Mercurial.