2020-10-09 02:29:06 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-11-03 04:36:02 +03:00
|
|
|
VERSION=dev
|
|
|
|
|
2020-10-09 02:29:06 +03:00
|
|
|
set -e
|
2020-12-03 00:44:10 +03:00
|
|
|
|
2020-12-18 23:36:19 +03:00
|
|
|
# The parking mapper doesn't work on WASM yet, so don't include it
|
2020-12-19 21:01:28 +03:00
|
|
|
for tool in game santa fifteen_min osm_viewer; do
|
2020-12-18 23:36:19 +03:00
|
|
|
cd $tool
|
2021-02-08 23:41:28 +03:00
|
|
|
wasm-pack build --release --target web -- --no-default-features --features wasm
|
2020-12-18 23:36:19 +03:00
|
|
|
cd pkg
|
|
|
|
# Temporarily remove the symlink to the data directory; it's uploaded separately by the updater tool
|
|
|
|
rm -f system
|
|
|
|
aws s3 sync . s3://abstreet/$VERSION/$tool
|
|
|
|
# Undo that symlink hiding
|
|
|
|
git checkout system
|
|
|
|
cd ../..
|
|
|
|
done
|
2020-12-03 00:44:10 +03:00
|
|
|
|
2020-11-02 23:30:56 +03:00
|
|
|
# Set the content type for .wasm files, to speed up how browsers load them
|
|
|
|
aws s3 cp \
|
2020-11-03 04:36:02 +03:00
|
|
|
s3://abstreet/$VERSION \
|
|
|
|
s3://abstreet/$VERSION \
|
2020-11-02 23:30:56 +03:00
|
|
|
--exclude '*' \
|
|
|
|
--include '*.wasm' \
|
|
|
|
--no-guess-mime-type \
|
|
|
|
--content-type="application/wasm" \
|
|
|
|
--metadata-directive="REPLACE" \
|
|
|
|
--recursive
|
2020-11-03 04:36:02 +03:00
|
|
|
echo "Have the appropriate amount of fun: http://abstreet.s3-website.us-east-2.amazonaws.com/$VERSION"
|