Sign inSign up

tbs1001/git-master-downsyncer

By tbs1001

•Updated about 5 years ago

Image
0

867

tbs1001/git-master-downsyncer repository overview

Stupid simple git master branch auto-updater.

Important volume, if you want to use it:

Important environment variables:

  • GIT_SRC: git clone URL
  • GIT_CHANGE_CHECK_TIME_IN_SEC: how often will be check
  • GIT_CHANGE_SIGNAL_CMD: an executed command, if the last check found and clone a new one (use to pull a port-trigger, touch a file for an inotify process etc.)
  • GIT_DEBUG: if it exists, the checks will be more chatty

How does it work? Extracted signatures from 'git ls-remote origin refs/heads/master'.

First run: /data/ git clone $GIT_SRC into /data/clone enter the app dir under /data/clone and get a signature rename /data/clone to /data/[sig1] make a symlink from /data/[sig1]/[appname] to ./current execute the signal command

Other runs: enter the app dir under /data/clone and get a signature compare the latest dir name /data/[sigX] if they are different -> see the first run meanwhile, it checks /data how many files have - if more than 3, remove the oldest one execute the signal command

Details: /root/bin/*.sh

Tag summary

Content type

Image

Digest

Size

15.1 MB

Last updated

about 5 years ago

docker pull tbs1001/git-master-downsyncer