codecombat/scripts/vagrant/core/fillMongo.sh

18 lines
488 B
Bash
Raw Normal View History

2015-03-26 16:36:38 -04:00
#!/bin/bash
# Original content copyright (c) 2014 dpen2000 licensed under the MIT license
mkdir -p /vagrant/temp
cd /vagrant/temp
rm -f dump.tar.gz
rm -rf dump
echo "Downloading mongo dump file..."
wget --no-verbose http://analytics.codecombat.com:8080/dump.tar.gz
tar xzf dump.tar.gz --no-same-owner
echo "Restoring mongo dump file..."
mongorestore --quiet --drop
2015-03-28 18:27:38 -04:00
if [ -d /vagrant/temp/backup ]
then
echo "Restoring mongo backup..."
2015-03-28 18:27:38 -04:00
cd /vagrant/temp/backup
mongorestore --quiet
2015-03-28 18:27:38 -04:00
fi