forked from django-de/2010.djangocon.eu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfabfile.py
29 lines (23 loc) · 812 Bytes
/
fabfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import tempfile
from fabric.api import local, env
APPS_TO_SYNC = ('accommodation', 'blog', 'schedule', 'speakers', 'talks', 'waitlist', 'sponsors', 'sprints')
def production():
env['epioapp'] = 'djangocon-eu-2011'
def staging():
env['epioapp'] = 'djangocon-eu-2011-staging'
def deploy():
local("./manage.py collectstatic")
epio('upload')
epio('django syncdb')
epio('django migrate')
epio('django flush_cache')
def sync_data():
with tempfile.NamedTemporaryFile(suffix='.json') as dumpfile:
epio('django dumpdata {0} > {1}'.format(
' '.join(APPS_TO_SYNC),
dumpfile.name))
local('./manage.py loaddata {0}'.format(dumpfile.name))
def epio(commandstring):
local("epio {0} -a {1}".format(
commandstring,
env['epioapp']))