Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.
/ docker-git-sync Public archive

A docker image allowing you to sync a folder with a git repository.

License

Notifications You must be signed in to change notification settings

bringnow/docker-git-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-git-sync

A docker image allowing you to sync a folder with a git repository.

To use it, you must pass the following environment variables:

  • GIT_REPO_URL: URL of the Git repository to sync to, for example ssh://[email protected]/foo/bar.git.
  • GIT_REPO_BRANCH: Branch of the Git repository to sync to, for example production. Defaults to master.
  • GIT_USER_EMAIL: E-Mail address of author to show in commits
  • GIT_USER_NAME: Name of author to show in commits

Optionally, you can set

  • CRON_TIME: The execution time of the sync cronjob. For the syntax check CronHowto. Default is every minute (*/1 * * * *).

Furthermore you need to setup the following two volumes:

  • /root/.ssh: This volume should contain a valid ssh key (id_rsa and id_rsa.pub) with write access to the specified git repository. Also it should contain a valid known_hosts file.
  • /sync-dir: The contents of this volume will be synced to the speciefied git repository. If this directory is not empty (but does not contain a git repository) the sync will be aborted. In this case you need to pass the flag --overwrite-local to the container or set the environment variable OVERWRITE_LOCAL to true.

After proper setup this image will execute a cron job every minute and sync the contents of the volume /sync-dir to the specified git repository.

Of course you can mount the volumes to some directories of the host.

About

A docker image allowing you to sync a folder with a git repository.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages