diff options
Diffstat (limited to '')
-rw-r--r-- | terminaldweller.com/cgit/bootstrap/Dockerfile | 3 | ||||
-rwxr-xr-x | terminaldweller.com/cgit/bootstrap/bootstrap.sh | 7 | ||||
-rwxr-xr-x | terminaldweller.com/cgit/bootstrap/docker-entrypoint.sh | 3 |
3 files changed, 9 insertions, 4 deletions
diff --git a/terminaldweller.com/cgit/bootstrap/Dockerfile b/terminaldweller.com/cgit/bootstrap/Dockerfile index fe212dd..2467f36 100644 --- a/terminaldweller.com/cgit/bootstrap/Dockerfile +++ b/terminaldweller.com/cgit/bootstrap/Dockerfile @@ -4,4 +4,5 @@ RUN apk update && apk add --no-cache git cronie busybox-initscripts COPY ./bootstrap.sh /bootstrap.sh COPY ./docker-entrypoint.sh /docker-entrypoint.sh COPY ./crontab /etc/crontabs/root -ENTRYPOINT ["/bootstrap.sh"] +RUN chmod 0744 /bootstrap.sh +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/terminaldweller.com/cgit/bootstrap/bootstrap.sh b/terminaldweller.com/cgit/bootstrap/bootstrap.sh index d504064..3481546 100755 --- a/terminaldweller.com/cgit/bootstrap/bootstrap.sh +++ b/terminaldweller.com/cgit/bootstrap/bootstrap.sh @@ -32,17 +32,20 @@ REPOS="cgrep \ grpc \ faultreiber \ luatablegen \ + magni \ cfe-extra" bootstrap() { for REPO in ${REPOS}; do - (cd "${GIT_REPO_DIR}" && git clone --bare "${ORIGIN_HTTPS}/${REPO}") + if [ ! -d ${GIT_REPO_DIR}/${REPO}.git ]; then + (cd "${GIT_REPO_DIR}" && git clone --bare "${ORIGIN_HTTPS}/${REPO}") + fi done } update_repos() { for REPO in ${REPOS}; do - (cd "${GIT_REPO_DIR}/${REPO}".git && git fetch || true) + (cd "${GIT_REPO_DIR}/${REPO}".git && git fetch origin *:*) done } diff --git a/terminaldweller.com/cgit/bootstrap/docker-entrypoint.sh b/terminaldweller.com/cgit/bootstrap/docker-entrypoint.sh index 833d95b..d6d7009 100755 --- a/terminaldweller.com/cgit/bootstrap/docker-entrypoint.sh +++ b/terminaldweller.com/cgit/bootstrap/docker-entrypoint.sh @@ -3,5 +3,6 @@ set -e set -x . /bootstrap.sh -on_startup /etc/gitrepos/ +bootstrap +update_repos crond -n -s -P |