当前位置: 首页>>代码示例>>Python>>正文


Python env.project_name方法代码示例

本文整理汇总了Python中fabric.api.env.project_name方法的典型用法代码示例。如果您正苦于以下问题:Python env.project_name方法的具体用法?Python env.project_name怎么用?Python env.project_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在模块fabric.api.env的用法示例。

在下文中一共展示了env.project_name方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: set_env

# 需要导入模块: from fabric.api import env [as 别名]
# 或者: from fabric.api.env import project_name [as 别名]
def set_env(config, version_tag=None):
    """
    Fabric environmental variable setup
    """
    # Bug: when setting this inside a function. Using host_string as workaround
    config_dict = get_config(config)
    env.hosts = [config_dict['HOST_NAME'], ]
    env.host_string = config_dict['HOST_NAME']

    env.project_name = config_dict['PROJECT_NAME']
    env.project_dir = posixpath.join('/srv/images/', env.project_name)
    env.use_ssh_config = True

    env.image_name = config_dict['IMAGE'].split(':')[0]
    env.base_image_name = env.image_name + '_base'
    env.version_tag = version_tag

    env.build_dir = '/srv/build'
    env.local_path = os.path.dirname(__file__) 
开发者ID:rehive,项目名称:service-notifications,代码行数:21,代码来源:fabfile.py


示例2: upload

# 需要导入模块: from fabric.api import env [as 别名]
# 或者: from fabric.api.env import project_name [as 别名]
def upload():
    """Upload entire project to server"""
    # Bug: when setting this inside a function. Using host_string as workaround
    run('mkdir -p /srv/images/'+env.project_name+'/')
    rsync_project(
        env.project_dir, './',
        exclude=(
            '.git', '.gitignore', '__pycache__', '*.pyc', '.DS_Store', 'environment.yml',
            'fabfile.py', 'Makefile', '.idea', 'bower_components', 'node_modules',
            '.env.example', 'README.md', 'var'
        ), delete=True)

# Wrapper Functions: 
开发者ID:rehive,项目名称:service-notifications,代码行数:15,代码来源:fabfile.py


示例3: wheels

# 需要导入模块: from fabric.api import env [as 别名]
# 或者: from fabric.api.env import project_name [as 别名]
def wheels():
    """
    Remotely build python binaries on image-factory server
    """
    with lcd(env.local_path):
        put('./requirements.txt', '/srv/build/wheel_requirements.txt')
        put('./etc/base_image/image_requirements.txt',
            '/srv/build/requirements.txt')

    with cd('/srv/build/wheelhouse'):
        run('rm -rf *.whl')

    compose(cmd='-f service.yml -p %s run --rm wheel-factory' %
            env.project_name, path='/srv/build') 
开发者ID:rehive,项目名称:service-notifications,代码行数:16,代码来源:fabfile.py


示例4: upload

# 需要导入模块: from fabric.api import env [as 别名]
# 或者: from fabric.api.env import project_name [as 别名]
def upload():
    """Upload entire project to server"""
    # Bug: when setting this inside a function. Using host_string as workaround
    run('mkdir -p /srv/images/'+env.project_name+'/')
    rsync_project(
        env.project_dir, './',
        exclude=(
            '.git', '.gitignore', '__pycache__', '*.pyc', '.DS_Store', 'environment.yml',
            'fabfile.py', 'Makefile', '.idea', 'bower_components', 'node_modules',
            '.env.example', 'README.md', 'var'
        ), delete=True)


# Wrapper Functions: 
开发者ID:rehive,项目名称:service-notifications,代码行数:16,代码来源:fabfile.py


示例5: heroku_bootstrap

# 需要导入模块: from fabric.api import env [as 别名]
# 或者: from fabric.api.env import project_name [as 别名]
def heroku_bootstrap():
    """Create an app for every environment on Heroku."""
    require('project_name')
    require('environments')

    info('Initializing Heroku apps...')

    set_remotes()

    for environment in env.environments:
        env.environment = environment
        env.app_name = '{}-{}'.format(env.project_name, env.environment)
        heroku_initialize_app() 
开发者ID:hypebeast,项目名称:flask-gulp-starter-kit,代码行数:15,代码来源:fabfile.py


示例6: heroku_configure_app

# 需要导入模块: from fabric.api import env [as 别名]
# 或者: from fabric.api.env import project_name [as 别名]
def heroku_configure_app():
    """Configure an app with a basic configuration."""
    require('environment')
    require('project_name')

    info('Configure app: {}'.format(env.app_name))

    local('heroku addons:create heroku-postgresql --remote {}'.format(env.environment))
    local('heroku pg:backups schedule DATABASE --at "04:00 UTC" --remote {}'.format(env.environment))
    local('heroku pg:promote DATABASE_URL --remote {}'.format(env.environment))
    local('heroku config:set SECRET_KEY="{}" --remote {}'.format(create_secret_key(), env.environment)) 
开发者ID:hypebeast,项目名称:flask-gulp-starter-kit,代码行数:13,代码来源:fabfile.py


示例7: set_remotes

# 需要导入模块: from fabric.api import env [as 别名]
# 或者: from fabric.api.env import project_name [as 别名]
def set_remotes():
    """Set git remotes for Heroku repositories."""
    require('project_name')
    info('Setting up git remotes for Heroku...')

    local('git remote add ci [email protected]:{}-ci.git'.format(env.project_name))
    local('git remote add stage [email protected]:{}-stage.git'.format(env.project_name))
    local('git remote add prod [email protected]:{}-prod.git'.format(env.project_name)) 
开发者ID:hypebeast,项目名称:flask-gulp-starter-kit,代码行数:10,代码来源:fabfile.py


示例8: init

# 需要导入模块: from fabric.api import env [as 别名]
# 或者: from fabric.api.env import project_name [as 别名]
def init(vagrant=False):
    """Prepare a local machine for development."""

    install_requirements()
    local('createdb %(project_name)s' % env)  # create postgres database
    manage('migrate') 
开发者ID:ShubhamBansal1997,项目名称:startupintro,代码行数:8,代码来源:fabfile.py


示例9: setup

# 需要导入模块: from fabric.api import env [as 别名]
# 或者: from fabric.api.env import project_name [as 别名]
def setup():
    run('mkdir -p {0.project_path}/{0.project_name}'.format(env))
    run('ln -s {0.project_path}/{0.project_name} ~/{0.project_name}'.format(env))

    with cd('~/{.project_name}'.format(env)):
        run('virtualenv -p python3 env') 
开发者ID:revolter,项目名称:DexRoBot,代码行数:8,代码来源:fabfile.py


示例10: cleanup

# 需要导入模块: from fabric.api import env [as 别名]
# 或者: from fabric.api.env import project_name [as 别名]
def cleanup():
    run('rm -r ~/{.project_name}'.format(env))
    run('rm -r {0.project_path}/{0.project_name}'.format(env)) 
开发者ID:revolter,项目名称:DexRoBot,代码行数:5,代码来源:fabfile.py


示例11: deploy

# 需要导入模块: from fabric.api import env [as 别名]
# 或者: from fabric.api.env import project_name [as 别名]
def deploy(filename=None):
    with cd('~/{.project_name}'.format(env)):
        if not filename:
            for source_filename in env.source_filenames:
                put('src/{}'.format(source_filename), '~/{.project_name}/'.format(env))

            run('source env/bin/activate; pip install -r requirements.txt')
        else:
            put('src/{}'.format(filename), '~/{.project_name}/'.format(env)) 
开发者ID:revolter,项目名称:DexRoBot,代码行数:11,代码来源:fabfile.py



注:本文中的fabric.api.env.project_name方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。