Skip to content
This repository has been archived by the owner on Apr 10, 2019. It is now read-only.

Commit

Permalink
Add support for switching branchs to fabfile
Browse files Browse the repository at this point in the history
  • Loading branch information
paulosman committed Jun 17, 2011
1 parent 403c4b5 commit 921005d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion fabfile.py
Expand Up @@ -29,17 +29,36 @@ def update():
run('git pull origin master')


def syncdb():
"""Run syncdb."""
run_manage_cmd('syncdb')


def migrate():
"""Run database migrations."""
run_manage_cmd('migrate')
# not implemented yet
pass


def compress():
"""Compress CSS / Javascript."""
run_manage_cmd('compress_assets')


def switch(branchname):
"""Switch branches"""
with cd(env.proj_root):
run('git checkout %s' % (branchname,))
run('git pull origin %s' % (branchname,))
syncdb()
migrate()
compress()
restart_apache()


def deploy():
update()
syncdb()
migrate()
compress()
restart_apache()

0 comments on commit 921005d

Please sign in to comment.