Clarify webhook behavior in docs/README
This commit is contained in:
parent
edaa75b8a5
commit
87503c6dce
10
README.md
10
README.md
|
|
@ -34,12 +34,16 @@ docker run -d \
|
||||||
nginx
|
nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example of webhooks usage
|
## Webhooks
|
||||||
**Webhook config example**
|
Webhooks are executed asynchronously from the main git-sync process. If a `webhook-url` is configured,
|
||||||
A webhook is configured using a set of CLI flags. At its most basic only `webhook-url` needs to be set.
|
when a change occurs to the local git checkout a call is sent using the method defined in `webhook-method`
|
||||||
|
(default to `POST`). git-sync will continually attempt this webhook call until it succeeds (based on `webhook-success-status`).
|
||||||
|
If unsuccessful, git-sync will wait `webhook-backoff` (default `3s`) before re-attempting the webhook call.
|
||||||
|
|
||||||
**Usage**
|
**Usage**
|
||||||
|
|
||||||
|
A webhook is configured using a set of CLI flags. At its most basic only `webhook-url` needs to be set.
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run -d \
|
docker run -d \
|
||||||
-v /tmp/git-data:/git \
|
-v /tmp/git-data:/git \
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ var flWebhookStatusSuccess = flag.Int("webhook-success-status", envInt("GIT_SYNC
|
||||||
var flWebhookTimeout = flag.Duration("webhook-timeout", envDuration("GIT_SYNC_WEBHOOK_TIMEOUT", time.Second),
|
var flWebhookTimeout = flag.Duration("webhook-timeout", envDuration("GIT_SYNC_WEBHOOK_TIMEOUT", time.Second),
|
||||||
"the timeout used when communicating with the webhook target")
|
"the timeout used when communicating with the webhook target")
|
||||||
var flWebhookBackoff = flag.Duration("webhook-backoff", envDuration("GIT_SYNC_WEBHOOK_BACKOFF", time.Second*3),
|
var flWebhookBackoff = flag.Duration("webhook-backoff", envDuration("GIT_SYNC_WEBHOOK_BACKOFF", time.Second*3),
|
||||||
"the duration to wait after a failed webhook call")
|
"if a webhook call fails (dependant on webhook-success-status) this defines how much time to wait before retrying the call")
|
||||||
|
|
||||||
var flUsername = flag.String("username", envString("GIT_SYNC_USERNAME", ""),
|
var flUsername = flag.String("username", envString("GIT_SYNC_USERNAME", ""),
|
||||||
"the username to use")
|
"the username to use")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue