This project is not in active development anymore
What#
Usually, we pack Git repository content into a Docker image and then distrubute it. That’s the idea of Docker. But, it can be another case, if we want to separate Git repository files lifecycle from the service deployments. In this scenario, we may want an image, that runs continuosly and pulls files from Git, putting them to a volume, which can be consumed from other services.
Usage#
Here is self-explanatory example:
1version: '3'
2services:
3 githelper:
4 environment:
5 # repository source
6 GIT_PROVIDER: github.com
7 GIT_ORIGIN: [email protected]:orgname/reponame.git
8 # branch to pull
9 GIT_REFERENCE: master
10 # interval
11 GIT_AUTOUPDATE_INTERVAL: 5m
12 # enable LFS
13 GIT_USE_LFS: "yes"
14 # key file to pull the repo (should be mounted from a secret store)
15 SSH_KEY_FILE_PATH: /run/secrets/repo-deploy-key
16 # file to put the pull status here (so consumer can get meta info from it)
17 GIT_STATUS_FILE: .git/status.json
18 # image to run
19 image: docker.pkg.github.com/soar/githelper/githelper:latest
20 # volume to put files
21 volumes:
22 - assets:/srv
23
24 another-service:
25 # volume to consume files from
26 volumes:
27 - assets:/srv