diff --git a/.epioignore b/.epioignore new file mode 100644 index 0000000..6a6c830 --- /dev/null +++ b/.epioignore @@ -0,0 +1,6 @@ +syntax: regex +^media/ +^static/ +^.gitignore$ +^.hg/ + diff --git a/.gitignore b/.gitignore index b92df6c..48497fb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ *.swp *.un~ *.db -static_root/ \ No newline at end of file +/media/* +/static_root/* + diff --git a/fabfile.py b/fabfile.py index e0a3301..aef2ac8 100644 --- a/fabfile.py +++ b/fabfile.py @@ -1,4 +1,4 @@ -from fabric.api import local, env +from fabric.api import local, env, require def production(): env['epioapp'] = # production epio instance name @@ -7,15 +7,20 @@ def staging(): env['epioapp'] = # staging epio instance def epio(commandstring): - local("epio {0} -a {1}".format( - commandstring, - env['epioapp'])) + require('epioapp', provided_by=['production','staging']) + from os import path + with lcd(path.dirname(__file__)): + local("epio {0} -a {1}".format( + commandstring, + env['epioapp'])) def deploy(): """ An example deploy workflow """ - local("./manage.py collectstatic") + epio('suspend') + local('./manage.py "collectstatic --noinput"') epio('upload') epio('django syncdb') epio('django migrate') epio('django epio_flush_cache') + epio('resume') diff --git a/media/.gitignore b/media/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/settings/base.py b/settings/base.py index 0bdbdad..82df73d 100644 --- a/settings/base.py +++ b/settings/base.py @@ -17,11 +17,11 @@ USE_I18N = True USE_L10N = True -MEDIA_ROOT = PROJECT_DIR.parent.child('data') +MEDIA_ROOT = PROJECT_DIR.child('media') MEDIA_URL = '/media/' - -STATIC_ROOT = PROJECT_DIR.child('static_root') +STATIC_ROOT = PROJECT_DIR.child('static-root') STATIC_URL = '/static/' + STATICFILES_DIRS = ( str(PROJECT_DIR.child('static')), ) @@ -87,4 +87,4 @@ 'propagate': True, }, } -} \ No newline at end of file +} diff --git a/settings/epio.py b/settings/epio.py index 105fc73..827caf6 100644 --- a/settings/epio.py +++ b/settings/epio.py @@ -1,6 +1,9 @@ from __future__ import absolute_import from .base import * +MEDIA_ROOT = PROJECT_DIR.parent.child('data') +STATIC_ROOT = PROJECT_DIR.child('static-root') + from bundle_config import config DATABASES = { 'default': { @@ -15,9 +18,7 @@ CACHES = { 'default': { 'BACKEND': 'redis_cache.RedisCache', - 'LOCATION': '{host}:{port}'.format( - host=config['redis']['host'], - port=config['redis']['port']), + 'LOCATION': '%(host)s:%(port)s' % config['redis'], 'OPTIONS': { 'PASSWORD': config['redis']['password'], }, diff --git a/static/.gitignore b/static/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/static_root/.gitignore b/static_root/.gitignore new file mode 100644 index 0000000..e69de29