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