-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_website.sh
executable file
·60 lines (51 loc) · 1.82 KB
/
build_website.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
ROOTDIR="${SCRIPTPATH}/.."
PKGDIR="${ROOTDIR}/aisdb"
RSTSOURCEDIR="${ROOTDIR}/docs/source"
MAPDIR="${ROOTDIR}/aisdb_web/map"
SPHINXDIR="${ROOTDIR}/docs/dist_sphinx"
WASMDIR="${ROOTDIR}/client_webassembly"
set -e
# jsdocs site build
#JSDOCDIR="${ROOTDIR}/aisdb_web/dist_jsdoc"
#cd "${SCRIPTPATH}"
#npx jsdoc \
# --recurse "${MAPDIR}" \
# --package "${ROOTDIR}/aisdb_web/package.json" \
# --destination "${JSDOCDIR}"
# webassembly components build for map
#[[ ! -f "$HOME/.cargo/bin/wasm-pack" ]] && echo "installing wasm-pack..." && curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
cd "${WASMDIR}"
if declare -p DEBUG ; then
echo 'building with profile dev ...'
wasm-pack build --target web --out-dir "${MAPDIR}/pkg" --dev
else
echo 'building with profile release ...'
wasm-pack build --target web --out-dir "${MAPDIR}/pkg" --release
fi
wasm-opt -O3 -o "${MAPDIR}/pkg/client_bg.wasm" "${MAPDIR}/pkg/client_bg.wasm"
#wasm-pack build --target web --out-dir "${MAPDIR}/pkg" --dev
# build map webapp
cd "${MAPDIR}"
npm --prefix "${ROOTDIR}/aisdb_web" install
#VITE_AISDBHOST=$AISDBHOST \
#VITE_AISDBPORT=$AISDBPORT \
#VITE_BINGMAPTILES=$VITE_BINGMAPTILES \
#VITE_TILESERVER=$VITE_TILESERVER \
#VITE_BINGMAPTILES=\
VITE_TILESERVER= a.tile.openstreetmap.org \
VITE_DISABLE_SSL_DB=1 \
VITE_DISABLE_STREAM=1 \
VITE_AISDBHOST=localhost \
VITE_AISDBPORT=9924 \
npx vite build --outDir "${MAPDIR}/../dist_map"
#zip -ru9 aisdb_web/dist_map.zip aisdb_web/dist_map/
VITE_BINGMAPTILES=1 \
VITE_TILESERVER=dev.virtualearth.net \
VITE_DISABLE_SSL_DB=1 \
VITE_DISABLE_STREAM=1 \
VITE_AISDBHOST=localhost \
VITE_AISDBPORT=9924 \
npx vite build --outDir "${MAPDIR}/../dist_map_bingmaps"
#zip -ru9 aisdb_web/dist_map_bingmaps.zip aisdb_web/dist_map_bingmaps/