publiccode.si/site/build/build.sh

31 lines
767 B
Bash
Raw Normal View History

#!/bin/bash
2017-09-07 17:43:54 +02:00
# Put all available languages here, except "en". Separated by spaces
TRANSLATIONS="de fr nl zh_tw"
basedir="${0%/*}/.."
cd "$basedir"
mode=$1
# Unite static and language-specific config files to a single file
2017-09-07 17:43:54 +02:00
for language in $TRANSLATIONS; do
languagefiles="$languagefiles languages/strings.$language.toml"
done
cat config-static.toml languages/strings.en.toml ${languagefiles} > config.toml
# Execute hugo buildrun
if [ "$mode" == "server" ]; then
hugo server
2017-09-12 09:59:04 +02:00
elif [ "$mode" == "syntax" ]; then
hugo
else
hugo
2017-09-12 09:56:30 +02:00
#
# After building the website, we set the AWS credentials and uploda
# everything to our AWS s3 bucket.
#
. /srv/cred/aws.sh
/usr/local/bin/aws s3 cp /usr/share/blog/public/ s3://aws-website-pmpc-soegm/ --recursive
fi