2024-10-03 21:00:16 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
usage() {
|
2024-10-29 14:56:41 +00:00
|
|
|
cat <<-EOF
|
|
|
|
# build.sh Usage
|
|
|
|
## General
|
|
|
|
This script is a wrapper script over ./build/build_main.sh that provides nicer option names, and the options to serve the files.
|
|
|
|
For documentation on the build script itself see ./build/README.md
|
|
|
|
## Flags
|
|
|
|
### -f | --full
|
|
|
|
Perform a full rebuild of the webpages.
|
|
|
|
### -s | --serve
|
|
|
|
Serve the build webpages over localhost.
|
|
|
|
### --
|
|
|
|
Everything after this is passed directly to build_main.
|
|
|
|
See ./build/README.md for valid options.
|
|
|
|
EOF
|
|
|
|
exit 1
|
2024-10-03 21:00:16 +00:00
|
|
|
}
|
|
|
|
command="build_run"
|
2024-10-14 21:50:44 +00:00
|
|
|
serve=""
|
2024-10-29 14:56:41 +00:00
|
|
|
extra_args=""
|
2024-10-03 21:00:16 +00:00
|
|
|
while [ "$#" -gt 0 ]; do
|
2024-10-29 14:56:41 +00:00
|
|
|
case "$1" in
|
|
|
|
--full | -f)
|
|
|
|
command="build_into" && shift 1
|
|
|
|
;;
|
|
|
|
--serve | -s)
|
|
|
|
serve="true" && shift 1
|
|
|
|
;;
|
|
|
|
--)
|
|
|
|
shift 1
|
|
|
|
while [ "$#" -gt 0 ]; do
|
|
|
|
extra_args+="$1 "
|
|
|
|
shift 1
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usage
|
|
|
|
;;
|
|
|
|
esac
|
2024-10-03 21:00:16 +00:00
|
|
|
done
|
2024-10-15 13:16:24 +00:00
|
|
|
mkdir -p ./output
|
2024-10-29 14:56:41 +00:00
|
|
|
./build/build_main.sh "$command" ./output/final --statusdir ./output/final/status.fsfe.org/fsfe.org/data $extra_args
|
2024-10-14 21:50:44 +00:00
|
|
|
if [[ "$serve" ]]; then
|
2024-10-29 14:56:41 +00:00
|
|
|
python3 ./serve-websites.py
|
2024-10-14 21:50:44 +00:00
|
|
|
fi
|