Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lamaani/git_autosync
A bash script to autosync (pull, execute on change) a git repo to a local machine.
https://github.com/lamaani/git_autosync
Last synced: 3 days ago
JSON representation
A bash script to autosync (pull, execute on change) a git repo to a local machine.
- Host: GitHub
- URL: https://github.com/lamaani/git_autosync
- Owner: LamaAni
- License: mit
- Created: 2019-09-25T06:51:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-10T21:06:29.000Z (almost 4 years ago)
- Last Synced: 2024-05-07T18:22:28.707Z (9 months ago)
- Language: Shell
- Homepage:
- Size: 74.2 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git_autosync script
A bash script and docker image for auto-syncing of a git repo.
The scripts allows for the continues update of a git repo, to folder, with a
minimal time delay of 1 second.#### Remember, if you like it, star it, so other people would also use it.
# BETA
#### Contributors are welcome :)
# Requirements
1. [bash shell]()
2. [git](https://git-scm.com/)# TL;DR
For inline help use,
```shell
git_autosync --help
```Sync the git_autosync repo itself into /tmp/sync
```shell
git_autosync /tmp/sync -r [email protected]:LamaAni/git_autosync.git
```# Usage in Kubernetes
For an example of how to use in kubernetes see [kubernetes_website_sidecar_autosync.yaml](examples/kubernetes_website_sidecar_autosync.yaml)
# Install
Downloads and installs from latest release,
```shell
curl -Ls "https://raw.githubusercontent.com/LamaAni/git_autosync/master/install?ts_$(date +%s)=$RANDOM" | sudo bash
```# Environment variables
name | description | default value
---|---|---
GIT_AUTOSYNC_REPO_LOCAL_PATH | The local path to the repo | `required!` or inline
GIT_AUTOSYNC_REPO_URL | The remote repo, will use the repo in the local path if not found.
GIT_AUTOSYNC_SSH_KEY | The ssh key to use. (private key) | empty
GIT_AUTOSYNC_SSH_KEY_PATH | The path to the ssh key to use. (private key) | empty
GIT_AUTOSYNC_REPO_BRANCH | The repo branch to use | master
GIT_AUTOSYNC_MAX_SYNC_RUN_COUNT | How many times to sync | -1 = infinity, 0 = just clone
GIT_AUTOSYNC_INTERVAL | The sync interval (seconds) | 5
GIT_AUTOSYNC_SYNC_COMMAND | The sync command to use | `git pull`
GIT_AUTOSYNC_RUN_ASYNC | If 1 then run the sync_loop in a different thread, will exist the process | 0
GIT_AUTOSYNC_CHECK_HOSTS | If 1 then the git host must be listed in the known_hosts | 0
GIT_AUTOSYNC_RUN_DO_CLONE | If 1, then try clone if dose not exist | 1
GIT_AUTOSYNC_ARGS | Extra args, space/newline delimited | empty
GIT_AUTOSYNC_FAIL_ON_NO_BRANCH | If 1, will fail when no branch is available. (Tag for example) | 0# Licence
Copyright ©
`Zav Shotan` and other [contributors](https://github.com/LamaAni/git_autosync/graphs/contributors).
It is free software, released under the MIT licence, and may be redistributed under the terms specified in `LICENSE`.