From 87503c6dce2ded9754a154bdf015dc35ffcf4025 Mon Sep 17 00:00:00 2001 From: Thomas Jackson Date: Tue, 22 Jan 2019 14:09:52 -0800 Subject: [PATCH] Clarify webhook behavior in docs/README --- README.md | 10 +++++++--- cmd/git-sync/main.go | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5b29934..fd50f87 100644 --- a/README.md +++ b/README.md @@ -34,12 +34,16 @@ docker run -d \ nginx ``` -## Example of webhooks usage -**Webhook config example** -A webhook is configured using a set of CLI flags. At its most basic only `webhook-url` needs to be set. +## Webhooks +Webhooks are executed asynchronously from the main git-sync process. If a `webhook-url` is configured, +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** +A webhook is configured using a set of CLI flags. At its most basic only `webhook-url` needs to be set. + ``` docker run -d \ -v /tmp/git-data:/git \ diff --git a/cmd/git-sync/main.go b/cmd/git-sync/main.go index 4ff79f7..d83fcec 100644 --- a/cmd/git-sync/main.go +++ b/cmd/git-sync/main.go @@ -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), "the timeout used when communicating with the webhook target") 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", ""), "the username to use")