My system has few git repositories with some c++ code in them. Users which send a request to my system are getting a binary executable compiled from all the git repositories together. A basic feature of this system is to send binary built from the latest version of the source. In order to do so, each time the system gets a request it runs git pull --all
, this command takes a lot of time. I want to avoid running the pull command when a request arrives and instead to make the system run the pull command automatically when the a new version is committed. How to do it automatically?
The only way I can think of is somehow to query the git server periodically every second or so and run the pull command every time there is a new commit in the remote repository but I think that polling is the last solution I'm looking for. Even so, how to implement this naive polling scheme and what alternatives do I got?