From 294e4e4ef634c7c63e9f9bf8b4718ee1109aebcd Mon Sep 17 00:00:00 2001 From: Roberto Aguilar Date: Thu, 10 May 2012 21:43:09 -0700 Subject: [PATCH] Added bootstrap script. This script will configure the baseline repo for development and deployment. --- bootstrap.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 bootstrap.sh diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..13b3459 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set +e + +# make sure we're in the project directory +SCRIPT_DIR=$(dirname $0) +cd "${SCRIPT_DIR}" + +# move origin over to baseline +git remote -v | grep -q '^baseline' || git remote rename origin baseline; + +if [ ! -e venv ]; then + virtualenv venv --distribute + venv/bin/pip install -r requirements.txt +fi; + +# create the virtual environment and install requirements +secret_key=baseline/secretkey.py +if [ ! -e ${secret_key} ]; then + venv/bin/python manage.py secretkey; + + git add ${secret_key} + git commit -m"Added ${secret_key}" ${secret_key} +fi; + +# create localsettings module +if [ ! -e baseline/localsettings.py ]; then + echo "DEBUG = True" >> baseline/localsettings.py +fi; + +# sync the local database +python manage.py syncdb +python manage.py migrate