A sidecar app which clones a git repo and keeps it in sync with the upstream.
Go to file
Tim Hockin 94ff3e8fae Fix non-master branches and tags
This plus the test should ensure no regressions.  Git makes it tricky to do
some things on a remote that you would think to do on a local repo.
`ls-remote` gives me the info I need with only one test for "HEAD" vs anything
else.
2016-10-28 17:02:25 +02:00
Godeps Clean up logging using glogr 2016-09-16 08:35:27 -07:00
demo Scrub 'contrib' 2016-08-20 14:17:17 -07:00
docs Add files from github.com/kubernetes/contrib/git-sync 2016-08-20 14:14:27 -07:00
vendor/github.com Clean up logging using glogr 2016-09-16 08:35:27 -07:00
.gitignore Overhaul Makefile and Dockerfile 2016-09-16 08:35:22 -07:00
CONTRIBUTING.md Create CONTRIBUTING.md 2016-08-22 16:18:11 -07:00
Dockerfile Overhaul Makefile and Dockerfile 2016-09-16 08:35:22 -07:00
LICENSE Initial commit 2016-08-20 14:09:57 -07:00
Makefile Add a test 2016-10-28 16:54:50 +02:00
OWNERS Add files from github.com/kubernetes/contrib/git-sync 2016-08-20 14:14:27 -07:00
README.md update README 2016-09-16 08:35:27 -07:00
code-of-conduct.md Create code-of-conduct.md 2016-08-22 16:18:58 -07:00
main.go Fix non-master branches and tags 2016-10-28 17:02:25 +02:00
main_test.go Add files from github.com/kubernetes/contrib/git-sync 2016-08-20 14:14:27 -07:00
ssh-wrapper.sh Add files from github.com/kubernetes/contrib/git-sync 2016-08-20 14:14:27 -07:00
test.sh Add a test 2016-10-28 16:54:50 +02:00

README.md

git-sync

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 files down from a repository so that an application can consume them.

git-sync can pull one time, or on a regular inteval. It can pull from the HEAD of a branch, or 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 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 symlink.

Usage

# build the container
make container REGISTRY=registry TAG=tag

# run the container
docker run -d \
    -v /tmp/git-data:/git \
    registry/git-sync:tag \
        --repo=https://github.com/kubernetes/git-sync
        --branch=master
        --wait=30

# run an nginx container to serve the content
docker run -d \
    -p 8080:80 \
    -v /tmp/git-data:/usr/share/nginx/html \
    nginx

Analytics