threadr.lostcave.ddnss.de/deployment-script.sh

20 lines
885 B
Bash

#!/bin/bash
echo "Deployment script for repository \"web-deployment\"
`date`
=============================================================================="
# activate ** globs
if [ -n "`shopt globstar | grep off`" ]; then shopt -s globstar; fi
# remove READMEs
rm ./src/**/README.md
# prepare build directory tree and static files
rm -r ./build
cp -r ./src ./build
rm ./build/**/*.{php,html,css,svg}
# run the macro handler
echo "`cd src; find -name "*.php" -or -name "*.html" -or -name "*.css" -or -name "*.svg" | sed 's/^/file=/;s/$/\; python3 variable_grabbler.py macros\/pass0\*.json src\/$file | python3 variable_grabbler.py macros\/pass1\*.json - | python3 variable_grabbler.py macros\/pass2\*.json - | python3 variable_grabbler.py macros\/pass3\*.json - > build\/$file/'`" | bash -
echo "==============================================================================
Done."