Clean up docs

This commit is contained in:
Tim Hockin 2019-11-25 14:13:04 -08:00
parent 5d7622e6ec
commit 0057fac0a4
2 changed files with 27 additions and 5 deletions

View File

@ -4,24 +4,42 @@ git-sync is a simple command that pulls a git repository into a local directory.
It is a perfect "sidecar" container in Kubernetes - it can periodically pull It is a perfect "sidecar" container in Kubernetes - it can periodically pull
files down from a repository so that an application can consume them. files down from a repository so that an application can consume them.
git-sync can pull one time, or on a regular interval. It can pull from the HEAD git-sync can pull one time, or on a regular interval. It can pull from the
of a branch, or from a git tag, or from a specific git hash. It will only HEAD of a branch, from a git tag, or from a specific git hash. It will only
re-pull if the target of the run has changed in the upstream repository. When re-pull if the target of the run has changed in the upstream repository. When
it re-pulls, it updates the destination directory atomically. In order to do it re-pulls, it updates the destination directory atomically. In order to do
this, it uses a git worktree in a subdirectory of the `--root` and flips a this, it uses a git worktree in a subdirectory of the `--root` and flips a
symlink. symlink.
git-sync can also be configured to make webhook call upon sucessful git repo syncronisation. The call is made when right after the symlink is updated. git-sync can pull over HTTP(S) (with authentication or not) or SSH.
## Usage git-sync can also be configured to make a webhook call upon successful git repo
synchronization. The call is made after the symlink is updated.
## Building it
``` ```
# build the container # build the container
make container REGISTRY=registry VERSION=tag make container REGISTRY=registry VERSION=tag
```
```
# build the container behind a proxy # build the container behind a proxy
make container REGISTRY=registry VERSION=tag HTTP_PROXY=http://<proxy_address>:<proxy_port> HTTPS_PROXY=https://<proxy_address>:<proxy_port> make container REGISTRY=registry VERSION=tag \
HTTP_PROXY=http://<proxy_address>:<proxy_port> \
HTTPS_PROXY=https://<proxy_address>:<proxy_port>
```
```
# build the container for an OS/arch other than the current (e.g. you are on
# MacOS and want to run on Linux)
make container REGISTRY=registry VERSION=tag \
GOOS=linux GOARCH=amd64
```
## Usage
```
# run the container # run the container
docker run -d \ docker run -d \
-v /tmp/git-data:/tmp/git \ -v /tmp/git-data:/tmp/git \
@ -38,6 +56,7 @@ docker run -d \
``` ```
## Webhooks ## Webhooks
Webhooks are executed asynchronously from the main git-sync process. If a `webhook-url` is configured, 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` 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`). (default to `POST`). git-sync will continually attempt this webhook call until it succeeds (based on `webhook-success-status`).
@ -56,4 +75,5 @@ docker run -d \
--wait=30 --wait=30
--webhook-url="http://localhost:9090/-/reload" --webhook-url="http://localhost:9090/-/reload"
``` ```
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/git-sync/README.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/git-sync/README.md?pixel)]()

2
go.mod
View File

@ -6,3 +6,5 @@ require (
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/prometheus/client_golang v0.9.2 github.com/prometheus/client_golang v0.9.2
) )
go 1.13