Init
This commit is contained in:
13
aux/bootstrap.sh
Executable file
13
aux/bootstrap.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# stop on error
|
||||
set -e
|
||||
|
||||
# start cron daemon (goes into background)
|
||||
crond
|
||||
|
||||
# pull and build freshly
|
||||
/aux/pull-n-build.sh
|
||||
|
||||
# run nginx
|
||||
nginx -g "daemon off;"
|
||||
20
aux/pull-n-build.sh
Executable file
20
aux/pull-n-build.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
# stop on error
|
||||
set -e -v
|
||||
|
||||
# check if initial git run
|
||||
if [ ! -d /repo ]; then
|
||||
# yes - repo needs to be cloned
|
||||
git clone --recurse-submodules $REPO_URL /repo
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user