527.md 3.0 KB
Newer Older
Lab机器人's avatar
readme  
Lab机器人 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
# Webhooks administration

> 原文:[https://docs.gitlab.com/ee/raketasks/web_hooks.html](https://docs.gitlab.com/ee/raketasks/web_hooks.html)

*   [Add a webhook to all projects](#add-a-webhook-to-all-projects)
*   [Add a webhook to projects in a namespace](#add-a-webhook-to-projects-in-a-namespace)
*   [Remove a webhook from projects](#remove-a-webhook-from-projects)
*   [Remove a webhook from projects in a namespace](#remove-a-webhook-from-projects-in-a-namespace)
*   [List all webhooks](#list-all-webhooks)
*   [List webhooks for projects in a namespace](#list-webhooks-for-projects-in-a-namespace)

# Webhooks administration[](#webhooks-administration-core-only "Permalink")

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

[管理员](../security/webhooks.html)可以允许或阻止通过[Webhook](../security/webhooks.html)[本地网络发出的](../security/webhooks.html)请求.

## Add a webhook to all projects[](#add-a-webhook-to-all-projects "Permalink")

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

```
# omnibus-gitlab
sudo gitlab-rake gitlab:web_hook:add URL="http://example.com/hook"

# source installations
bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" RAILS_ENV=production 
```

## Add a webhook to projects in a namespace[](#add-a-webhook-to-projects-in-a-namespace "Permalink")

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

```
# omnibus-gitlab
sudo gitlab-rake gitlab:web_hook:add URL="http://example.com/hook" NAMESPACE=<namespace>

# source installations
bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" NAMESPACE=<namespace> RAILS_ENV=production 
```

## Remove a webhook from projects[](#remove-a-webhook-from-projects "Permalink")

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

```
# omnibus-gitlab
sudo gitlab-rake gitlab:web_hook:rm URL="http://example.com/hook"

# source installations
bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" RAILS_ENV=production 
```

## Remove a webhook from projects in a namespace[](#remove-a-webhook-from-projects-in-a-namespace "Permalink")

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

```
# omnibus-gitlab
sudo gitlab-rake gitlab:web_hook:rm URL="http://example.com/hook" NAMESPACE=<namespace>

# source installations
bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" NAMESPACE=<namespace> RAILS_ENV=production 
```

## List all webhooks[](#list-all-webhooks "Permalink")

要列出所有 webhooks,请运行:

```
# omnibus-gitlab
sudo gitlab-rake gitlab:web_hook:list

# source installations
bundle exec rake gitlab:web_hook:list RAILS_ENV=production 
```

## List webhooks for projects in a namespace[](#list-webhooks-for-projects-in-a-namespace "Permalink")

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

```
# omnibus-gitlab
sudo gitlab-rake gitlab:web_hook:list NAMESPACE=<namespace>

# source installations
bundle exec rake gitlab:web_hook:list NAMESPACE=<namespace> RAILS_ENV=production 
```