From 48bc5c779635cd369672405483082115d4f5112b Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Sun, 18 Dec 2022 14:48:14 +0330 Subject: update --- terminaldweller.com/cgit/bootstrap/Dockerfile | 3 ++- terminaldweller.com/cgit/bootstrap/bootstrap.sh | 7 +++++-- terminaldweller.com/cgit/bootstrap/docker-entrypoint.sh | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'terminaldweller.com/cgit/bootstrap') 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 -- cgit v1.2.3