Helix TeamHub HTTP
Use a bot account instead of personal credentials. The two options are:
- Use a regular bot, and give it access to relevant projects and repositories on the team view
- Use a company admin bot account, which has access to every repository inside the company
For more information, see Bots & programmatic repository access in Helix TeamHub User Guide.
The target repo must NOT already exist in Helix Server.
The source repo must not be empty.
On the Git Connector server
- Log in as the
git
OS user or the user you specified when configuring the Git Connector. - Configure the webhook for mirroring:Tip
Copy the URL from your project's HTTP drop-down box.
- Set the environment variable
GCONN_CONFIG
to the absolute path to thegconn.conf
file:export GCONN_CONFIG=/opt/perforce/git-connector/gconn.conf
- Add the web hook:
gconn --mirrorhooks add graphDepotName/repoName git@HelixTeamHubServer/companyName/projects/projectName/repositories/gitrepoName
where access-token:secret represents your personal access token for GitHub or GitLab.
- Save the secret token that the
--mirrorhooks
command generates.
TipThe secret token is also stored in
/opt/perforce/git-connector/repos/graphDepotName/repoName.git/.mirror.config
Mirror a repo over HTTP
-
Select Hooks, Add Hook, and select a repository from the drop-down.
- Select the service WebHook from the drop-down.
- Check the triggers that you want to launch a mirroring action.
- Under Hook attributes:
- Paste the URL of the Git Connector into the URL text box:
https://GitConnector.com/mirrorhooks
- Select content-type of json (application/json) from the drop-down.
- Paste the mirrorhook secret token in the Secret text box.
- Check the Insecure ssl checkbox because no certificate is associated with the webhook.
- Paste the URL of the Git Connector into the URL text box:
-
Click Save hook.
- Validate that mirroring is in place by running the following command on the Git Connector:
gconn --mirrorhooks list
This displays the repositories that are mirrored and the Git Host. For example:
gconn --mirrorhooks list
//hth/repoName <<< http://HelixTeamHub.com/hth/projects/projectName/repositories/git/repoName.git ...
//hth/repoName2 <<< http://HelixTeamHub.com/hth/projects/projectName/repositories/git/repoName2.git ... Not mirrored by this Gconn instance ( no mirror config )
Troubleshooting
If there are any issues, review the following files, or send them to Perforce Technical Support:
Helix TeamHub log at /var/log/hth/resque/current
and from the Git Connector:
/opt/perforce/git-connector/repos/graphDepot/repoName.git/.mirror.config
/opt/perforce/git-connector/repos/graphDepot/repoName.git/push_log
/opt/perforce/git-connector/repos/graphDepot/repoName.git/fetch_log
/opt/perforce/git-connector/repos/graphDepot/repoName.git/.mirror.log
/opt/perforce/git-connector/gconn.conf
/opt/perforce/git-connector/logs/gconn.log
/opt/perforce/git-connector/logs/p4gc.log