-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup_mongo_debug.sh
40 lines (32 loc) · 1.09 KB
/
setup_mongo_debug.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
#!/bin/bash
lat=12.9
lng=77.8
while read -r latitude longitude
do
lat=$latitude
lng=$longitude
done < coordinates.txt
echo "Your coordinates latitude/longitude are: " $lat $lng
cd ~/workspace
# Either clone or pull latest.
QEATS_SHARED_RESOURCES="${HOME}/workspace/qeats_shared_resources"
if [ ! -d $QEATS_SHARED_RESOURCES ]
then
git clone [email protected]:me_qeats_shared/qeats_shared_resources.git $QEATS_SHARED_RESOURCES
else
cd $QEATS_SHARED_RESOURCES
git pull
fi
if systemctl status mongodb.service | grep active > /dev/null; then
echo "MongoDB is running..."
else
echo "MongoDB not running; Exiting"
exit -1
fi
# Ensure a clean slate & populate all collections
mongo restaurant-database --eval "db.dropDatabase()"
mongorestore --host localhost --db restaurant-database --gzip --archive=$QEATS_SHARED_RESOURCES/DEBUG_V2/restaurants-debug-gzipped-mongo-dump.gz
pip3 install pymongo
# Localize restaurants
echo "Localizing restaurants for your region, so that you can see them when you load the app..."
python3 $QEATS_SHARED_RESOURCES/localize_restaurants.py $lat $lng 200