Set up Code Search for TeamForge-Git integration

To use TeamForge Code Search functionality for Git, manually grant the TeamForge Code Search user permissions to access all Git repositories.

  1. You need the root user's public key for SSH authentication on the Code Search server. Do the following:
    1. On the Code Search server, check whether the key is present at /root/.ssh/id_rsa.pub. If not, generate it by running the ssh-keygen command.
    2. Copy it to a temporary location (/tmp) on the TeamForge application server.
    3. Run the set_auth_key.py script for the scmviewer user on the TeamForge application server.
      • cd /opt/collabnet/teamforge/runtime/scripts/codesearch/
      • ./set_auth_key.py --authkey-file=/tmp/id_rsa.pub
  2. Sync the scmviewer user to Gerrit by running the following command in a shell on the host where you installed the Git integration.
    • curl http://localhost:9081/api/gerrit/users/scmviewer/sshkeys
  3. Log into the Gerrit console as the 'scmadmin' user and create an internal Gerrit group, for example, 'CodeSight Group'.
    1. Select People > Create New Group from the menu. The Create Group page appears.
    2. Type a name for the group, for example, 'CodeSight Group', and click Create Group. The group is created.
  4. Add the scmviewer user to the group.

    Type Code Search <scmviewer@localhost> user name in the Members text box and click Add.

  5. Grant read access to the group.
    1. Select Projects > List > All Projects.
    2. Select Access and click Edit.
    3. Click Add Group in the Reference: refs/* > Read section, type the newly created group name, for example, 'CodeSight Group', and click Add.
    4. Click Save Changes.
  6. Log out from Gerrit.
  7. Restart the Code Search server.
    • /etc/init.d/collabnet restart tomcatcs