You need to enable JavaScript to run this app.
文档中心
持续交付

持续交付

复制全文
下载 pdf
触发器常见问题
Gerrit 配置 Webhook 推送
复制全文
下载 pdf
Gerrit 配置 Webhook 推送
对于 Gerrit 代码仓库,开启代码源触发后,您需前往对应代码仓库配置流水线的 Webhook 地址。​
背景信息​
Gerrit 代码仓库一般为私有化部署,仓库界面没有 Webhook 配置入口,用户需在本地编写完成 webhooks.config 文件,并将该配置文件推送至对应 project 下的 refs/meta/config 分支。​
前提条件​
已勾选目标流水线的事件触发设置,并且将对应的流水线 Webhook URL 复制出来。具体操作请参见 代码源触发。​
操作步骤​
  1. 拉取 Gerrit 代码仓库远端分支。​
​
git fetch origin refs/meta/config:refs/remotes/origin/meta/config​
​
  1. 切换到 meta/config 分支。​
​
git checkout meta/config​
​
  1. 编写 webhooks.config 文件。​
  • ​
    vim webhooks.config​
    [remote "changemerged"] ​
    url = ${webhook\_url} # 填入准备好的流水线 Webhook URL ​
    event = change-merged # 推送事件的名称 ​
    maxTries = 2 ​
    sslVerify = false ​
    ​
  1. 将该配置文件推送至目标 project 下的 refs/meta/config 分支。​
​
git add . && git commit -m "add webhook config" && git push origin meta/config:meta/config​
​
​
最近更新时间:2025.09.04 19:20:16
这个页面对您有帮助吗?
有用
有用
无用
无用