2018-12-07 13:19:46 +00:00
|
|
|
#!/bin/sh -ex
|
|
|
|
# environment variables:
|
|
|
|
# * PUBLISH: upload manuals after building if set to "1"
|
|
|
|
|
|
|
|
base="$PWD"
|
|
|
|
export OSMO_GSM_MANUALS_DIR="$base/osmo-gsm-manuals"
|
|
|
|
|
|
|
|
# Sanity check
|
|
|
|
if ! [ -d "$base/doc/manuals" ]; then
|
|
|
|
echo "ERROR: this script needs to be executed from the top dir of osmo-gsm-tester.git."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Clone/update osmo-gsm-manuals and wipe local modifications
|
|
|
|
if [ -d "$OSMO_GSM_MANUALS_DIR" ]; then
|
|
|
|
git -C "$OSMO_GSM_MANUALS_DIR" pull
|
|
|
|
else
|
2023-11-29 08:56:21 +00:00
|
|
|
git clone "https://gerrit.osmocom.org/osmo-gsm-manuals" "$OSMO_GSM_MANUALS_DIR"
|
2018-12-07 13:19:46 +00:00
|
|
|
fi
|
|
|
|
git -C "$OSMO_GSM_MANUALS_DIR" checkout -f HEAD
|
|
|
|
|
|
|
|
# Copy manuals source to empty temp dir (so we can easily clean up afterwards)
|
|
|
|
temp="$base/_manuals_temp"
|
|
|
|
if [ -d "$temp" ]; then
|
|
|
|
rm -rf "$temp"
|
|
|
|
fi
|
|
|
|
cp -r "$base/doc/manuals" "$temp"
|
|
|
|
|
|
|
|
# Build the manuals
|
|
|
|
cd "$temp"
|
|
|
|
make
|
|
|
|
make check
|
|
|
|
|
|
|
|
# Publish
|
|
|
|
if [ "$PUBLISH" = "1" ]; then
|
|
|
|
make publish
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Clean up
|
|
|
|
rm -r "$temp"
|