From 5d296b1aab8bd5d2e91f03f35231dc5848ed27f3 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Thu, 13 Aug 2015 10:25:36 +0100 Subject: [PATCH] SDE update script A script to assist with SDE updates, resolves #20 --- sde_update.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sde_update.sh diff --git a/sde_update.sh b/sde_update.sh new file mode 100644 index 0000000..e42b511 --- /dev/null +++ b/sde_update.sh @@ -0,0 +1,25 @@ +#!/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