-
Notifications
You must be signed in to change notification settings - Fork 4
/
run.sh
executable file
·50 lines (41 loc) · 1004 Bytes
/
run.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
#!/bin/bash
set -e
MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $MY_DIR
RUN_MODE=$1
DOWNLOAD=true
GENERATE_MBTILES=true
# Parse command line options
while [[ "$#" -gt 0 ]]; do
case $1 in
--skip-download)
DOWNLOAD=false
;;
--skip-mbtiles)
GENERATE_MBTILES=false
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift
done
if [ "$DOWNLOAD" = true ]; then
echo "Downloading..."
npm run download
fi
if [ -z "$CLUSTERING_ARANGODB_URL" ]; then
echo "Starting clustering DB..."
docker compose up -d
CLUSTERING_ARANGODB_URL="http://$(docker compose port arangodb 8529)"
fi
echo "Converting to GeoJSON..."
CLUSTERING_ARANGODB_URL=$CLUSTERING_ARANGODB_URL npm run prepare-geojson
if [ -z "$CLUSTERING_ARANGODB_URL" ]; then
docker compose down
fi
if [ "$GENERATE_MBTILES" = true ]; then
echo "Convert to MBTiles..."
./generate_mbtiles.sh
fi