def inner_update(): fab_git.checkout_branch() fab_git.pull() with cd(env.root): # this must be run in the root git directory fab_git.update_submodules() fab_git.clean() fab_bhoma.reset_forms() fab_bhoma.collectstatic() fab_bhoma.syncdb()
def migrate_rev2(): """Migrate the application from rev1 to rev2""" require('root', provided_by=('central', 'dimagi', 'clinic')) with cd(get_app_dir()): # replicate database to backup run("python manage.py backup_db bhoma_rev_1 --noinput") # delete database run("python manage.py delete_db --noinput") # sync database fab_bhoma.syncdb() # migrate user accounts run("python manage.py migrate_rev2_data bhoma_rev_1") update_crontabs()