Git repo must be subdir (otherwise initial clone fails)

This commit is contained in:
Stefan Schlott 2022-08-26 19:09:57 +02:00
parent 3686d1c9d7
commit f597a33756
2 changed files with 5 additions and 4 deletions

View file

@ -7,7 +7,7 @@ COPY scripts/update-site.sh /usr/local/bin/
# Home directory of user, containing ssh keys, etc. # Home directory of user, containing ssh keys, etc.
VOLUME /data VOLUME /data
# Website source # Website source
ENV WEBSITE_SOURCE=/website-source ENV WEBSITE_SOURCE=/website-source/git
VOLUME /website-source VOLUME /website-source
# Compiled website # Compiled website
VOLUME /website VOLUME /website

View file

@ -6,11 +6,12 @@ if [[ "$WEBSITE_SOURCE" == "" ]] ; then
fi fi
# Update site # Update site
if [[ -d "$WEBSITE_SOURCE/.git" ]] ; then
cd $WEBSITE_SOURCE cd $WEBSITE_SOURCE
if [[ -d .git ]] ; then
git pull || exit 1 git pull || exit 1
else 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 fi
# Update Twitter # Update Twitter