2020-02-08 00:36:50 +01:00
|
|
|
#!/bin/bash
|
2020-02-12 10:26:59 +01:00
|
|
|
echo "Deployment script for repository \"web-deployment\"
|
|
|
|
`date`
|
|
|
|
=============================================================================="
|
2020-02-12 05:49:44 +01:00
|
|
|
|
2021-09-08 09:20:38 +02:00
|
|
|
# activate ** globs
|
2020-03-12 22:21:48 +01:00
|
|
|
if [ -n "`shopt globstar | grep off`" ]; then shopt -s globstar; fi
|
2021-09-08 09:20:38 +02:00
|
|
|
# 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}
|
2020-03-12 22:21:48 +01:00
|
|
|
|
2021-09-08 09:20:38 +02:00
|
|
|
# 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 > build\/$file/'`" | bash -
|
|
|
|
echo "`cd src; find -name "*.php" -or -name "*.html" -or -name "*.css" -or -name "*.svg" | sed 's/^/file=/;s/$/\; python3 variable_grabbler.py macros\/pass1\*.json src\/$file > build\/$file/'`" | bash -
|
|
|
|
echo "`cd src; find -name "*.php" -or -name "*.html" -or -name "*.css" -or -name "*.svg" | sed 's/^/file=/;s/$/\; python3 variable_grabbler.py macros\/pass2\*.json src\/$file > build\/$file/'`" | bash -
|
|
|
|
echo "`cd src; find -name "*.php" -or -name "*.html" -or -name "*.css" -or -name "*.svg" | sed 's/^/file=/;s/$/\; python3 variable_grabbler.py macros\/pass3\*.json src\/$file > build\/$file/'`" | bash -
|
2020-02-19 03:54:48 +01:00
|
|
|
|
2020-02-12 10:26:59 +01:00
|
|
|
echo "==============================================================================
|
|
|
|
Done."
|