site/build.sh
Simon Bruder 281157346e
Add option to build for staging
This uses a different base url and adds uses an all-blocking robots.txt.
2021-12-11 17:44:04 +01:00

23 lines
477 B
Bash
Executable file

#!/usr/bin/env bash
set -e
declare -a zola_options
SCHABERNACK_ENV=${SCHABERNACK_ENV:-production}
if [ "${SCHABERNACK_ENV}" = "staging" ]; then
echo "Building staging version" >&2
zola_options+=(-u https://staging.schulischer-schabernack.de)
fi
./metadata.py
zola build ${zola_options[@]}
echo "Encoding…"
./encode.py
./metadata.py
zola build ${zola_options[@]}
if [ "${SCHABERNACK_ENV}" = "staging" ]; then
cp static/robots.txt.staging public/robots.txt
fi