Write script log
This commit is contained in:
parent
fce2368393
commit
159dbe4b34
@ -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
|
||||||
# yes - repo needs to be cloned
|
date
|
||||||
git clone --recurse-submodules $REPO_URL /repo
|
|
||||||
else
|
|
||||||
# no - pull existing repo
|
|
||||||
cd /repo && git pull --recurse-submodules
|
|
||||||
fi
|
|
||||||
|
|
||||||
# build and copy over
|
# check if initial git run
|
||||||
cd /repo && \
|
if [ ! -d /repo ]; then
|
||||||
hugo && \
|
# yes - repo needs to be cloned
|
||||||
rm -rf /usr/share/nginx/html/* && \
|
git clone --recurse-submodules $REPO_URL /repo
|
||||||
cp -R /repo/public/* /usr/share/nginx/html
|
else
|
||||||
|
# no - pull existing repo
|
||||||
|
cd /repo && git pull --recurse-submodules
|
||||||
|
fi
|
||||||
|
|
||||||
|
# build and copy over
|
||||||
|
cd /repo && \
|
||||||
|
hugo && \
|
||||||
|
rm -rf /usr/share/nginx/html/* && \
|
||||||
|
cp -R /repo/public/* /usr/share/nginx/html
|
||||||
|
|
||||||
|
} 2>&1 > /var/log/blogker-pull-n-build.log
|
||||||
|
Loading…
Reference in New Issue
Block a user