diff --git a/bootstrap.sh b/bootstrap.sh index 38d37a11..c0058e56 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -11,6 +11,8 @@ sudo apt-get -y install python-pip cd /vagrant/ sudo pip install --upgrade pip + +# Pip moved location after upgrade from 1.0 sudo ln -s /usr/local/bin/pip /usr/bin/pip 2>/dev/null sudo apt-get -y install libmysqlclient-dev @@ -23,21 +25,13 @@ sudo pip install --allow-external libffi-dev libffi-dev #TODO collect user input and use that to populate the passwords sudo apt-get -y install mysql-server-5.5 sudo apt-get -y install rabbitmq-server -sudo apt-get -y install python-xmpp +#sudo apt-get -y install python-xmpp sudo pip install -r requirements.txt +chmod +x *.sh -# TODO Extract the rest of this file to separate shell script - - - -## comment out bootstrap_permissions() before sync, as per instructions -#cp groupmanagement/__init__.py groupmanagement/__init__.py.bak -#sed "s/bootstrap_permissions()/#bootstrap_permissions()/" groupmanagement/__init__.py.bak > groupmanagement/__init__.py -#python manage.py syncdb -#mv groupmanagement/__init__.py.bak groupmanagement/__init__.py - -#python manage.py celeryd --verbosity=2 --loglevel=DEBUG -#python manage.py celerybeat --verbosity=2 --loglevel=DEBUG -#python manage.py runserver \ No newline at end of file +echo '--------' +echo 'This would be a good point to adjust mysql passwords, as well as all the stuff ' +echo 'in ./alliance_auth/settings.py otherwise startup.sh will not work.' +echo '--------' \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 278d06f7..9a87a129 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ mysql-python dnspython passlib +xmpppy==0.5.0rc1 # Django Stuff # django==1.6.1 diff --git a/run_alliance_corp_update.py b/run_alliance_corp_update.py new file mode 100644 index 00000000..c41709f2 --- /dev/null +++ b/run_alliance_corp_update.py @@ -0,0 +1,6 @@ +from util import bootstrap_permissions +from celerytask.tasks import run_alliance_corp_update + +bootstrap_permissions() +run_alliance_corp_update() +quit() diff --git a/shutdown.sh b/shutdown.sh new file mode 100755 index 00000000..4743ed09 --- /dev/null +++ b/shutdown.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +ps ww | grep 'manage.py' | grep -v grep | awk '{print $1}' | xargs kill diff --git a/startup.sh b/startup.sh new file mode 100755 index 00000000..54999021 --- /dev/null +++ b/startup.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# TODO route log output to file. +python manage.py syncdb + +python manage.py shell < run_alliance_corp_update.py + +python manage.py celeryd --verbosity=2 --loglevel=DEBUG & +python manage.py celerybeat --verbosity=2 --loglevel=DEBUG & + +python manage.py runserver &