From f597a33756f8b3025d566653253334a8e5ca529d Mon Sep 17 00:00:00 2001 From: Stefan Schlott Date: Fri, 26 Aug 2022 19:09:57 +0200 Subject: [PATCH] Git repo must be subdir (otherwise initial clone fails) --- Dockerfile-siteupdate | 2 +- scripts/update-site.sh | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile-siteupdate b/Dockerfile-siteupdate index bdbd2647..0cc6f4b1 100644 --- a/Dockerfile-siteupdate +++ b/Dockerfile-siteupdate @@ -7,7 +7,7 @@ COPY scripts/update-site.sh /usr/local/bin/ # Home directory of user, containing ssh keys, etc. VOLUME /data # Website source -ENV WEBSITE_SOURCE=/website-source +ENV WEBSITE_SOURCE=/website-source/git VOLUME /website-source # Compiled website VOLUME /website diff --git a/scripts/update-site.sh b/scripts/update-site.sh index 5b82fb05..35a1dc65 100755 --- a/scripts/update-site.sh +++ b/scripts/update-site.sh @@ -6,11 +6,12 @@ if [[ "$WEBSITE_SOURCE" == "" ]] ; then fi # Update site -cd $WEBSITE_SOURCE -if [[ -d .git ]] ; then +if [[ -d "$WEBSITE_SOURCE/.git" ]] ; then + cd $WEBSITE_SOURCE git pull || exit 1 else - git clone git@github.com:cccs/cccs-website.git . || exit 1 + git clone git@github.com:cccs/cccs-website.git "$WEBSITE_SOURCE" || exit 1 + cd $WEBSITE_SOURCE fi # Update Twitter