diff options
author | Christian Franke <nobody@nowhere.ws> | 2012-03-29 00:25:29 +0200 |
---|---|---|
committer | Christian Franke <nobody@nowhere.ws> | 2012-03-29 00:25:29 +0200 |
commit | 8809d029b870162f531be217a4a28af8d438f030 (patch) | |
tree | 73e511134d729128d5368e919418b99714d7c511 /fabfile/helpers.py | |
parent | 46630946201c43aa805fe3cd4de453a5f10442ec (diff) |
Fixup fabfile
Diffstat (limited to 'fabfile/helpers.py')
-rw-r--r-- | fabfile/helpers.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/fabfile/helpers.py b/fabfile/helpers.py index 9409ca0..ddeb7b8 100644 --- a/fabfile/helpers.py +++ b/fabfile/helpers.py @@ -26,8 +26,12 @@ def update_project(): """ require('src_root', provided_by=['setups.stage', 'setups.production']) require('git_branch', provided_by=['setups.stage', 'setups.production']) - with cd(env.src_root): - run('git pull origin %(git_branch)s' % env) + + if files.exists(env.src_root): + with cd(env.src_root): + run('git pull origin %(git_branch)s' % env) + else: + run('git clone -b %(git_branch)s %(git_url)s %(src_root)s' % env) def link_settings(): @@ -41,32 +45,33 @@ def link_settings(): else: host_settings = join_path(env.config, '%(host)s.py' % env) settings = join_path(env.proj_root, 'local_settings.py') - if files.exists(settings): - run('rm %s' % settings) if files.exists(host_settings): - run('ln -s %s %s' % (host_settings, settings)) + run('ln -sf %s %s' % (host_settings, settings)) else: - print 'No host specific settings file found. Create one at %s' % host_settings + abort('No host specific settings file found. Create one at %s' % host_settings) def collect_static(): """Collects all static files. """ - manage('collectstatic') + manage('collectstatic --noinput') @task def syncdb(): """Runs the syncdb management command. """ - manage('syncdb') + manage('syncdb --noinput') @task def migrate(app_name=None): """Runs the migrations for one or all apps. """ - manage('migrate %s' % app_name) + if app_name is None: + manage('migrate') + else: + manage('migrate %s' % app_name) @task(alias='id') |