Commit f9d56c4f authored by Ronan OConnor's avatar Ronan OConnor

Merge branch 'update-docs-trigger-immediate-pull' into 'master'

Include in docs how to trigger an immediate pull

See merge request gitlab-org/gitlab!32567
parents d29ffa79 8ec15f34
...@@ -356,6 +356,24 @@ a [Push event webhook](../integrations/webhooks.md#push-events) to trigger an im ...@@ -356,6 +356,24 @@ a [Push event webhook](../integrations/webhooks.md#push-events) to trigger an im
pull to GitLab. Push mirroring from GitLab is rate limited to once per minute when only push mirroring pull to GitLab. Push mirroring from GitLab is rate limited to once per minute when only push mirroring
protected branches. protected branches.
### Configure a webhook to trigger an immediate pull to GitLab
Assuming you have already configured the [push](#setting-up-a-push-mirror-to-another-gitlab-instance-with-2fa-activated) and [pull](#pulling-from-a-remote-repository-starter) mirrors in the upstream GitLab instance, to trigger an immediate pull as suggested above, you will need to configure a [Push Event Web Hook](../integrations/webhooks.md#push-events) in the downstream instance.
To do this:
- Create a [personal access token](../../profile/personal_access_tokens.md) with `API` scope.
- Navigate to **Settings > Webhooks**
- Add the webhook URL which in this case will use the [Pull Mirror API](../../../api/projects.md#start-the-pull-mirroring-process-for-a-project-starter) request to trigger an immediate pull after updates to the repository.
```plaintext
https://gitlab.example.com/api/v4/projects/:id/mirror/pull?private_token=<your_access_token>
```
- Ensure that the **Push Events** checkbox is selected.
- Click on **Add Webhook** button to save the webhook.
- To test the integration click on the **Test** button and confirm GitLab does not return any error.
### Preventing conflicts using a `pre-receive` hook ### Preventing conflicts using a `pre-receive` hook
CAUTION: **Warning:** CAUTION: **Warning:**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment