(use_pypi=False, index="dev", build=True, user=None, version=None)
Install the backend from the given devpi index at the given version on the target host and restart the service.

    If version is None, it defaults to the latest version

    Optionally, build and upload the application first from local sources. This requires a
    full backend development environment on the machine running this command (pyramid etc.)
Install the backend from the given devpi index at the given version on the target host and restart the service.
Install the backend from the given devpi index at the given version on the target host and restart the service .
def update_backend(use_pypi=False, index="dev", build=True, user=None, version=None):
    """
    Install the backend from the given devpi index at the given version on the target host and restart the service.

    If version is None, it defaults to the latest version

    Optionally, build and upload the application first from local sources. This requires a
    full backend development environment on the machine running this command (pyramid etc.)
    """
    get_vars()
    if value_asbool(build):
        upload_backend(index=index, user=user)
    with fab.cd("{apphome}".format(**AV)):
        if value_asbool(use_pypi):
            command = "bin/pip install --upgrade %s"
        else:
            command = "bin/pip install --upgrade --pre -i {ploy_default_publish_devpi}/briefkasten/{index}/+simple/ %s".format(
                index=index, user=user, **AV
            )
        if version:
            app_command = "%s==%s" % (command, version)
        else:
            app_command = command
        fab.sudo(app_command % 'briefkasten')
        theme_package = AV.get('ploy_theme_package')
        if theme_package is not None and theme_package != 'briefkasten':
            theme_command = command % theme_package
            fab.sudo(theme_command)

    briefkasten_ctl("restart")
def update_backend ( use_pypi = False , index = "dev" , build = True , user = None , version = None ) : get_vars ( ) if value_asbool ( build ) : upload_backend ( index = index , user = user ) with fab . cd ( "{apphome}" . format ( * * AV ) ) : if value_asbool ( use_pypi ) : command = "bin/pip install --upgrade %s" else : command = "bin/pip install --upgrade --pre -i {ploy_default_publish_devpi}/briefkasten/{index}/+simple/ %s" . format ( index = index , user = user , * * AV ) if version : app_command = "%s==%s" % ( command , version ) else : app_command = command fab . sudo ( app_command % 'briefkasten' ) theme_package = AV . get ( 'ploy_theme_package' ) if theme_package is not None and theme_package != 'briefkasten' : theme_command = command % theme_package fab . sudo ( theme_command ) briefkasten_ctl ( "restart" )