Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
    def local(*args, **kwargs):
        if is_localhost(env.host_string):
            return nofabric.local(*args, **kwargs)

        else:
            return fabric_local(*args, **kwargs)
Пример #4
0
def local(*args, **kwargs):
    kwargs.setdefault('capture', True)
    return fabric_local(*args, **kwargs)
Пример #5
0
    def local(*args, **kwargs):
        if is_localhost(env.host_string):
            return nofabric.local(*args, **kwargs)

        else:
            return fabric_local(*args, **kwargs)
Пример #6
0
def local(command, **kwargs):
    return fabric_local(command, **kwargs)