def push(*args, **kwargs): allowed_args = set( ['notest', 'syncdb', 'migrate', 'pip_update', 'norestart']) for arg in args: if arg not in allowed_args: puts('Invalid argument: %s' % arg) puts('Valid arguments are: %s' % allowed_args) return vcs.push() delete_pyc() with cd('src/' + env.conf['INSTANCE_NAME']): vcs.up() if 'pip_update' in args: pip_update(restart=False) if 'syncdb' in args: dj_cmd.syncdb() if 'migrate' in args: dj_cmd.migrate() dj_cmd.collectstatic() dj_cmd.manage('compress') # execute 'before_restart' callback kwargs.get('before_restart', lambda: None)() if 'norestart' not in args: uwsgi.uwsgi_reload() celery.celery_restart()
def push(*args, **kwargs): allowed_args = set(['notest', 'syncdb', 'migrate', 'pip_update', 'norestart']) for arg in args: if arg not in allowed_args: puts('Invalid argument: %s' % arg) puts('Valid arguments are: %s' % allowed_args) return vcs.push() delete_pyc() with cd('src/' + env.conf['INSTANCE_NAME']): vcs.up() if 'pip_update' in args: virtualenv.pip_update(restart=False) if 'syncdb' in args: dj_cmd.syncdb() if 'migrate' in args: dj_cmd.migrate() dj_cmd.collectstatic() dj_cmd.manage('compress') # execute 'before_restart' callback kwargs.get('before_restart', lambda: None)() if 'norestart' not in args: uwsgi.uwsgi_reload()
def full_deploy(): """ Prepares server and deploys the project. """ #TODO: install vim, mс system.prepare_server() deploy_project() chmod.set_chmod() dj_cmd.collectstatic() dj_cmd.manage('compress')
def deploy_project(): """ Deploys project on prepared server. """ virtualenv.virtualenv_create() deploy.make_clone() virtualenv.pip_install(env.conf.PIP_REQUIREMENTS, restart=False) setup_web_server() dj_cmd.syncdb() dj_cmd.migrate() dj_cmd.collectstatic() dj_cmd.manage('compress')