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")
def restart_uwsgi(*args, **kwargs): return restart(deployment(*args, **kwargs))
def stop_uwsgi(*args, **kwargs): return stop(deployment(*args, **kwargs))
def bootstrap(force=False): from config import deployment deploy = deployment() deploy.bootstrap(force)
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())