Exemplo n.º 1
0
def deploy(branch=None, fast=False, fake=False,*args, **kwargs):
    try:
        from config import deployment
        deploy = deployment(branch=branch, fast=fast, fake=fake, *args, **kwargs)
        deploy.run()
    except ImportError:
        from traceback import print_exc
        print_exc()
        logging.error("Deployment: you're doing it wrong. Where is the config?")
        logging.error("Hint: cd to a project dir with the config.py file")
Exemplo n.º 2
0
def restart_uwsgi(*args, **kwargs):
    return restart(deployment(*args, **kwargs))
Exemplo n.º 3
0
def stop_uwsgi(*args, **kwargs):
    return stop(deployment(*args, **kwargs))
Exemplo n.º 4
0
def bootstrap(force=False):
    from config import deployment
    deploy = deployment()
    deploy.bootstrap(force)
Exemplo n.º 5
0
    except ImportError:
        from traceback import print_exc
        print_exc()
        logging.error("Deployment: you're doing it wrong. Where is the config?")
        logging.error("Hint: cd to a project dir with the config.py file")


if __name__ == 'fabfile':
    try:
        from aliases import *
    except ImportError:
        pass

    """
    Kind of a hack. deployment initializes fabric's env. Without this,
    fabric wouldn't be informed about any roledefs (this section is parsed
    before execution of functions)
    """
    try:
        from config import deployment
        deployment()
    except ImportError:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        from traceback import print_tb, print_stack, print_exc
        print_tb(exc_traceback)
        print_stack()
        print_exc()
        logging.error("Couldn't import deployment class from config module")
        logging.error("Are you in the projects dir? Apparently not!")
        logging.error(getcwd())