2016-02-18 07:16:47 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Get the parent directory of where this script is.
|
|
|
|
SOURCE="${BASH_SOURCE[0]}"
|
|
|
|
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
|
|
|
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
|
|
|
|
|
|
|
# Change into that dir because we expect that.
|
|
|
|
cd $DIR
|
|
|
|
|
2016-11-08 22:37:16 +00:00
|
|
|
# Make sure build tools are available.
|
2016-11-03 00:27:49 +00:00
|
|
|
make tools
|
2016-02-18 07:16:47 +00:00
|
|
|
|
|
|
|
# Build the standalone version of the web assets for the sanity check.
|
|
|
|
pushd ui
|
|
|
|
bundle
|
|
|
|
make dist
|
|
|
|
popd
|
|
|
|
|
|
|
|
# Fixup the timestamps to match what's checked in. This will allow us to cleanly
|
|
|
|
# verify that the checked-in content is up to date without spurious diffs of the
|
|
|
|
# file mod times.
|
|
|
|
pushd pkg
|
2017-06-21 21:43:07 +00:00
|
|
|
cat ../agent/bindata_assetfs.go | ../scripts/fixup_times.sh
|
2016-02-18 07:16:47 +00:00
|
|
|
popd
|
|
|
|
|
|
|
|
# Regenerate the built-in web assets. If there are any diffs after doing this
|
|
|
|
# then we know something is up.
|
2016-11-03 00:27:49 +00:00
|
|
|
make static-assets
|
2017-06-21 21:43:07 +00:00
|
|
|
if ! git diff --quiet agent/bindata_assetfs.go; then
|
2016-02-18 07:16:47 +00:00
|
|
|
echo "Checked-in web assets are out of date, build aborted"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-07-18 06:13:46 +00:00
|
|
|
# Now we are ready to do a clean build of everything. We no longer distribute the
|
|
|
|
# web UI so it's ok that gets blown away as part of this.
|
2016-02-18 07:16:47 +00:00
|
|
|
rm -rf pkg
|
2016-11-03 00:27:49 +00:00
|
|
|
make all
|
2016-02-18 07:16:47 +00:00
|
|
|
|
|
|
|
exit 0
|