def local(string): if env.target == STAGING: fabric_local(string) elif env.target == PRODUCTION: fabric_local(string) elif env.target == DEV: with shell_env(DJANGO_READ_DOT_ENV_FILE="True"): fabric_local(string)
def set_defaults(): 'Set default environment values.' env.deploy_user = getpass.getuser() env.deploy_hostname = socket.gethostname() env.format = True env.pypi = 'http://pypi.python.org/simple' env.python = 'python' env.virtualenv = 'virtualenv -p {python} --no-site-packages --distribute'.format(**env) env.now = datetime.now().strftime('%Y%m%d%H%M%S') try: env.gitrev = fabric_local('git describe --dirty', capture=True) except: env.gitrev = None env.base = '{now}-{gitrev}'.format(**env)
def local(*args, **kwargs): if is_localhost(env.host_string): return nofabric.local(*args, **kwargs) else: return fabric_local(*args, **kwargs)
def local(*args, **kwargs): kwargs.setdefault('capture', True) return fabric_local(*args, **kwargs)
def local(command, **kwargs): return fabric_local(command, **kwargs)