Webhooks administration

原文:https://docs.gitlab.com/ee/raketasks/web_hooks.html

Webhooks administration

GitLab 提供用于 Webhooks 管理的 Rake 任务.

管理员可以允许或阻止通过Webhook本地网络发出的请求.

Add a webhook to all projects

要将 webhook 添加到所有项目,请运行:

  1. # omnibus-gitlab
  2. sudo gitlab-rake gitlab:web_hook:add URL="http://example.com/hook"
  3. # source installations
  4. bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" RAILS_ENV=production

Add a webhook to projects in a namespace

要将 Webhook 添加到特定名称空间中的所有项目,请运行:

  1. # omnibus-gitlab
  2. sudo gitlab-rake gitlab:web_hook:add URL="http://example.com/hook" NAMESPACE=<namespace>
  3. # source installations
  4. bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" NAMESPACE=<namespace> RAILS_ENV=production

Remove a webhook from projects

要从所有项目中删除 Webhook,请运行:

  1. # omnibus-gitlab
  2. sudo gitlab-rake gitlab:web_hook:rm URL="http://example.com/hook"
  3. # source installations
  4. bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" RAILS_ENV=production

Remove a webhook from projects in a namespace

要从特定名称空间的项目中删除 Webhook,请运行:

  1. # omnibus-gitlab
  2. sudo gitlab-rake gitlab:web_hook:rm URL="http://example.com/hook" NAMESPACE=<namespace>
  3. # source installations
  4. bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" NAMESPACE=<namespace> RAILS_ENV=production

List all webhooks

要列出所有 webhooks,请运行:

  1. # omnibus-gitlab
  2. sudo gitlab-rake gitlab:web_hook:list
  3. # source installations
  4. bundle exec rake gitlab:web_hook:list RAILS_ENV=production

List webhooks for projects in a namespace

要列出指定名称空间中项目的所有 webhook,请运行:

  1. # omnibus-gitlab
  2. sudo gitlab-rake gitlab:web_hook:list NAMESPACE=<namespace>
  3. # source installations
  4. bundle exec rake gitlab:web_hook:list NAMESPACE=<namespace> RAILS_ENV=production