Write script log

This commit is contained in:
maride 2023-07-28 09:18:39 +02:00
parent fce2368393
commit 159dbe4b34

View File

@ -3,18 +3,23 @@
# stop on error # stop on error
set -e -v set -e -v
# check if initial git run {
if [ ! -d /repo ]; then # Log date
date
# check if initial git run
if [ ! -d /repo ]; then
# yes - repo needs to be cloned # yes - repo needs to be cloned
git clone --recurse-submodules $REPO_URL /repo git clone --recurse-submodules $REPO_URL /repo
else else
# no - pull existing repo # no - pull existing repo
cd /repo && git pull --recurse-submodules cd /repo && git pull --recurse-submodules
fi fi
# build and copy over # build and copy over
cd /repo && \ cd /repo && \
hugo && \ hugo && \
rm -rf /usr/share/nginx/html/* && \ rm -rf /usr/share/nginx/html/* && \
cp -R /repo/public/* /usr/share/nginx/html cp -R /repo/public/* /usr/share/nginx/html
} 2>&1 > /var/log/blogker-pull-n-build.log