Configure Gerrit for HTTP

Important

The target repo must NOT already exist in Helix Server.

The source repo must not be empty.

On the Git Connector server

  1. Log in as the git OS user or the user you specified when configuring the Git Connector.

  2. Configure the webhook for mirroring:

    Tip

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

    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 https://access-token:secret@GerritHost.com/project/repoName.git

      where access-token:secret represents your personal access token for Gerrit.

  3. Save the secret token that the --mirrorhooks command generates, which is not related to the personal access token for Gerrit.
    Tip

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

On the Gerrit server

  1. Update the configuration file for the Gerrit repository in the $GERRIT_SITE/git/repoName/config file,

    where $GERRIT_SITE represents the root directory of your Gerrit server.

    [gconn]
    mirror-url = https://GitConnector.com/mirrorhooks
    token = <secret_token from /opt/perforce/git-connector/repos/graphDepot/repoName.git/.mirror.config>
    git-http-url = <upstream_url from /opt/perforce/git-connector/repos/graphDepot/repoName.git/.mirror.config>
    [gconn "http"]
    sslverify = false

Next step

Testing the mirror hook