@@ -0,0 +1,1194 @@
+from fabric.api import *%0A%0ATOMO_HOST = 'tomo.fmf.uni-lj.si'%0ATOMO_DIR = '/srv/tomodev/'%0ATOMO_VIRTUALENV = '/srv/tomodev/virtualenv'%0A%0Aenv.hosts = %5BTOMO_HOST%5D%0A%0A%0A# MAIN TASKS%0A%0A@task%0Adef test():%0A    with prefix('source ~/.virtualenv/tomo/bin/activate'):%0A        local('web/manage.py test')%0A%0A%0A@task%0Adef deploy():%0A    test()%0A    transfer_code()%0A    update_requirements()%0A    manage('collectstatic --noinput')%0A    manage('migrate')%0A    restart()%0A%0A%0A@task%0Adef reset():%0A    manage('flush')%0A    manage('loaddata web/fixtures/*.json')%0A%0A%0A# AUXILLIARY FUNCTIONS%0A%0Adef activate_virtualenv():%0A    return prefix('source %7B%7D/bin/activate'.format(TOMO_VIRTUALENV))%0A%0A%0Adef manage(command):%0A    with cd(TOMO_DIR), activate_virtualenv():%0A        return sudo('web/manage.py %7B%7D --settings=web.settings.dev'.format(command))%0A%0A%0Adef transfer_code():%0A    local('rsync -chavzP --rsync-path=%22sudo rsync%22 --exclude-from=.gitignore '%0A          '--delete web %7B%7D:%7B%7D'.format(TOMO_HOST, TOMO_DIR))%0A%0A%0Adef update_requirements():%0A    with cd(TOMO_DIR), activate_virtualenv():%0A        sudo('pip install -r web/requirements/dev.txt'.format(TOMO_VIRTUALENV))%0A%0A%0Adef restart():%0A    with cd(TOMO_DIR):%0A        sudo('touch web/web/wsgi/dev.py')%0A

Add a fabfile