README.md
git-autopush
Script+container image that periodically mirrors a local repository to a remote location, e.g. keep a gitlab/github mirror up-to-date with a repo hosted on a private server
Example docker run command:docker run --rm --env-file .env -v ./ssh:/ssh:ro -v ./git:/git:ro "$(docker build -q .)"
./ssh should contain your key for pushing./git should contain the repositores you want to push
.env parameters
- PUSH_KEY: file name of the private ssh key in the
sshdirectory to be used for pushing, e.g.id_rsa - PUSH_DELAY: how long to sleep between pushes, should be a string compatible with sleep(1)
- PUSH_URLS: a
|andspaceseparated list of urls and directory names, e.g.git@someserver:myrepo myrepo.git|git@someserver:myotherrepo myrepo2.gitgit@someserver:myrepoandgit@someserver:myotherrepoare the urls passed to git as a push destinationmyrepo.gitandmyrepo2.gitare directory names relates to/gitinside the container
TODO
- allow custom refspecs to be added (for e.g. git-bug)
- port script to python and use json config instead of environment variables