Files
dropbot/sde_update.sh
Andrew Williams 5d296b1aab SDE update script
A script to assist with SDE updates, resolves #20
2015-08-13 10:25:36 +01:00

26 lines
673 B
Bash

#!/bin/bash
SDE_URL="https://www.fuzzwork.co.uk/dump/sqlite-latest.sqlite.bz2"
echo "Downloading SDE from ${SDE_URL}"
curl -o sde.sqlite.bz2 "${SDE_URL}" && bunzip2 sde.sqlite.bz2
if [ -e sde.sqlite ]; then
echo "Generating reference data"
/usr/bin/env python gen_reference_data.py sde.sqlite
cp *.json dropbot/data/
echo "Running unit tests"
/usr/bin/env python setup.py test > /dev/null 2>&1
if [ $? -eq 0 ]; then
git add dropbox/data/*.json
git status
echo "SDE data updated successfully"
else
echo "Unit tests failed, please investigate"
fi
else
echo "Error downloading SDE"
exit 1
fi