예제 #1
0
def config(action=None, key=None, value=None):
    '''Manage project configuration using .env

    Usages: fab config:set,[key],[value]

    see: https://github.com/theskumar/python-dotenv
    '''
    command = 'dotenv'
    command += ' -f %(dotenv_path)s ' % env
    command += action + " " if action else " "
    command += key + " " if key else " "
    command += value if value else ""
    env.config_setter('touch %(dotenv_path)s' % env)

    with virtualenv():
        env.config_setter(command)
예제 #2
0
def config(action=None, key=None, value=None):
    '''Manage project configuration using .env

    Usages: fab config:set,[key],[value]

    see: https://github.com/theskumar/python-dotenv
    '''
    command = 'dotenv'
    command += ' -f %(dotenv_path)s ' % env
    command += action + " " if action else " "
    command += key + " " if key else " "
    command += value if value else ""
    env.config_setter('touch %(dotenv_path)s' % env)

    with virtualenv():
        env.config_setter(command)
예제 #3
0
def config(action=None, key=None, value=None):
    '''Read/write to .env file on local and remote machines.

    Usages: fab [prod] config:set,<key>,<value>
            fab [prod] config:get,<key>
            fab [prod] config:unset,<key>
            fab [prod] config:list
    '''
    import dotenv
    command = dotenv.get_cli_string(env.dotenv_path, action, key, value)
    env.config_setter('touch %(dotenv_path)s' % env)

    if env.config_setter == local:
        with virtualenv():
            env.config_setter(command)
    else:
        env.config_setter(command)
        restart_servers()
예제 #4
0
def config(action=None, key=None, value=None):
    """Read/write to .env file on local and remote machines.

    Usages: fab [prod] config:set,<key>,<value>
            fab [prod] config:get,<key>
            fab [prod] config:unset,<key>
            fab [prod] config:list
    """
    import dotenv
    command = dotenv.get_cli_string(env.dotenv_path, action, key, value)
    env.config_setter('touch %(dotenv_path)s' % env)

    if env.config_setter == local:
        with virtualenv():
            env.config_setter(command)
    else:
        env.config_setter(command)
        restart_servers()