GitHub or GitLab SSH

Important

The target repo must NOT already exist in Helix Server.
The source repo must not be empty.

  1. On the Git Connector server, log in as the root user.

  2. Create a .ssh directory:
    UbuntuCentOS
    mkdir /var/www/.sshmkdir /usr/share/httpd/.ssh
  3. Assign the owner of the directory to be the web-service-user:
    UbuntuCentOS
    chown web-service-user:gconn-auth /var/www/.sshchown web-service-user:gconn-auth /usr/share/httpd/.ssh
  4. Switch user from root to the web-service-user:

    Ubuntu CentOS

    su -s /bin/bash - www-data

    su -s /bin/bash - apache

    and generate the public and private SSH keys for the Git Connector instance:

    ssh-keygen -t rsa -b 4096 -C web-service-user@gitConnector.com

    then follow the prompts.

  5. Locate the public key:
  6. Ubuntu CentOS

    /var/www/.ssh/id_rsa.pub

    /usr/share/httpd/.ssh/id_rsa.pub

  7. Copy this public key to the GitLab or GitHub server and add to the user account (helix-user) that performs clone and fetch for mirroring.
  8. Configure the webhook for mirroring:
    1. Set the environment variable GCONN_CONFIG to the absolute path to the gconn.conf file:

      export GCONN_CONFIG=/opt/perforce/git-connector/gconn.conf

    2. Add the web hook:

      gconn --mirrorhooks add graphDepotName/repoName [email protected]/project/repoName.git

      where access-token:secret represents your personal access token for GitHub or GitLab.

    Tip

    Copy the URL from your project's SSH drop-down box.

  9. Save the secret token that the --mirrorhooks command generates.

    Tip

    The secret token is also stored in /opt/perforce/git-connector/repos/graphDepotName/repoName.git/.mirror.config

Mirror a repo over SSH

  1. Go to https://GitHost.com/project/repoName/hooks
  2. Paste the URL of the Git Connector into the URL text box: https://GitConnector.com/mirrorhooks
  3. Paste the webhook secret token in the Secret Token text box.
  4. Uncheck Enable SSL verification.
  5. Click Add Webhook.
  6. Click the lower-right corner Test button to validate the web hook is correctly set up.