@task
def deploy(c, dump_modifier_function=None, live=False, redo_rsa=False):
    f = io.StringIO()
    c.run('{}/django_venv/bin/python setup.py --fullname'.format(TEST_DEPLOY_DIRECTORY), out_stream=f)
    current_app_fullname = f.getvalue().strip()
    f.close()
    c.run('{}/django_venv/bin/python setup.py sdist'.format(TEST_DEPLOY_DIRECTORY))
    local_tarball = './dist/{}.tar.gz'.format(current_app_fullname)
    c.run('{}/django_venv/bin/pip install {}'.format(TEST_DEPLOY_DIRECTORY, local_tarball))
    dump_fname = '{}/dump.json'.format(TEST_DEPLOY_DIRECTORY)
    resp = requests.get('https://rajk.uni-corvinus.hu/djangodump.json')
    with open(dump_fname, 'wb') as fp:
        fp.write(resp.content)
    if (dump_modifier_function is not None):
        use_dump_modifier_function(dump_modifier_function, dump_fname)
    c.run('rm {}/rajkproject/db.sqlite3'.format(TEST_DEPLOY_DIRECTORY))
    for django_command in ['makemigrations', 'makemigrations {}'.format(current_app_fullname.split('-')[0]), 'migrate', 'loaddata {}'.format(dump_fname)]:
        c.run('{}/django_venv/bin/python {}/rajkproject/manage.py {}'.format(TEST_DEPLOY_DIRECTORY, TEST_DEPLOY_DIRECTORY, django_command))
    if live:
        _live_deploy(c, local_tarball, current_app_fullname, dump_modifier_function, redo_rsa)
@task
def deploy(c, dump_modifier_function=None, live=False, redo_rsa=False):
    f = io.StringIO()
    c.run('{}/django_venv/bin/python setup.py --fullname'.format(TEST_DEPLOY_DIRECTORY), out_stream=f)
    current_app_fullname = f.getvalue().strip()
    f.close()
    c.run('{}/django_venv/bin/python setup.py sdist'.format(TEST_DEPLOY_DIRECTORY))
    local_tarball = './dist/{}.tar.gz'.format(current_app_fullname)
    c.run('{}/django_venv/bin/pip install {}'.format(TEST_DEPLOY_DIRECTORY, local_tarball))
    dump_fname = '{}/dump.json'.format(TEST_DEPLOY_DIRECTORY)
    resp = requests.get('https://rajk.uni-corvinus.hu/djangodump.json')
    with open(dump_fname, 'wb') as fp:
        fp.write(resp.content)
    if (dump_modifier_function is not None):
        use_dump_modifier_function(dump_modifier_function, dump_fname)
    c.run('rm {}/rajkproject/db.sqlite3'.format(TEST_DEPLOY_DIRECTORY))
    for django_command in ['makemigrations', 'makemigrations {}'.format(current_app_fullname.split('-')[0]), 'migrate', 'loaddata {}'.format(dump_fname)]:
        c.run('{}/django_venv/bin/python {}/rajkproject/manage.py {}'.format(TEST_DEPLOY_DIRECTORY, TEST_DEPLOY_DIRECTORY, django_command))
    if live:
        _live_deploy(c, local_tarball, current_app_fullname, dump_modifier_function, redo_rsa)