To use TeamForge Code Search functionality
with Git, manually grant the TeamForge Code Search user scmviewer
permissions to access all Git repositories.
In
TeamForge 6.2 (and later versions), Code
Search functionality is available through integration with
Black Duck Code Sight.
Note: If you have integrated Code Search
functionality already while installing an older version of the TeamForge–Git integration, you can skip the following instructions
because the installer would have migrated your settings.
-
Make sure that a Unix system user with the name scmviewer exists. If
not, create this user by running the following command:
-
Before you can set up Code Search for the Git integration, import the Code Search public
key into TeamForge.
-
On the Code Search box, check whether the key is present at
/root/.ssh/id_rsa.pub. If not, generate it by running the
ssh-keygen command.
-
Copy it to a temporary location (/tmp) on the TeamForge
application
server.
-
Run the set_auth_key.py script
for the scmviewer user on the TeamForge
application
server.
Note: This script requires TeamForge site
administrator credentials.
-
cd /opt/collabnet/teamforge/runtime/scripts/codesearch/
-
./set_auth_key.py --authkey-file=/tmp/id_rsa.pub
-
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
Once the scmviewer user is present in Gerrit, you must grant this user read permissions for
all Gerrit projects. Log into Gerrit’s Web interface as a Gerrit super user and so the following:
-
On the People tab, click Create New
Group
and create an internal Gerrit group.
-
Add the scmviewer user to the group.
-
On the Projects tab, click
All-Projects.
-
On the Access tab, click Edit.
Here's an example:
You will see Reference display
ref/*.
-
For Group Name in the Read section, enter the name of the
internal group you created.
-
Select ALLOW for the users you want to grant read access.
-
Click Save Changes.
-
Log out from Gerrit.
After the initial re-indexing, you should be able to use Code Search with Git.