Helix4Git管理者ガイド (2019.1)

HTTP用にGerritを設定する

重要

ターゲットリポが既にHelixサーバ内に存在していてはいけません。

ソースリポは、空になっていてはいけません。

Git Connectorサーバでの操作

  1. git OSユーザまたはGit Connectorの設定時に指定したユーザとしてログインします。

  2. ミラーリング用にWebhookを設定します。

    ヒント

    使用するプロジェクトのHTTPドロップダウンボックスからURLをコピーします。

    1. 環境変数GCONN_CONFIGgconn.confファイルへの絶対パスに設定します。

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

    2. Webhookを追加します。

      gconn --mirrorhooks add graphDepotName/repoName https://access-token:secret@GerritHost.com/project/repoName.git

      access-token:secretはGerritのパーソナルアクセストークンを表します。

  3. --mirrorhooksコマンドで生成するsecretトークンを保存します。これは、Gerritのパーソナルアクセストークンには関連していません。
    ヒント

    secretトークンも/opt/perforce/git-connector/repos/graphDepotName/repoName.git/.mirror.configに保存されます。

Gerritサーバでの処理

  1. $GERRIT_SITE/git/repoName/configファイルのGerritリポジトリの構成ファイルを更新します。

    この場合、$GERRIT_SITEは、使用するGerritサーバのルートディレクトリです。

    [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

次の手順

ミラーフックのテスト