在织物和料理之上构建的糖衣陈述性部署配方

cuisine_sweet的Python项目详细描述


构建在Fabric之上的糖衣声明式部署配方 以及Cuisine

使用fabric的低级远程ssh编排和菜系的通用菜谱;目标 是构建一个包装器集合,捕获各种(通常是自以为是的)系统部署 风格。

cuisine_sweet的核心是ensure模块的集合。这些模块封装 正在检查/部署的内容(声明性的),而不指定如何和在何处执行部分 (命令)。如果表单中需要,确保既是断言检查+操作: ensure.object.state(params)

示例用法

cuisine_sweet将与fabric一起使用。

要说明用法,请参见下面的示例fabfile.py

from fabric.api import task, env
from cuisine_sweet import ensure

env.hosts = [ 'myproject@server1.example.com', 'myproject@server2.example.com' ]

@task
def initial():
    ensure.yum.package_installed('gcc')
    ensure.yum.package_installed('make')
    ensure.yum.package_installed('git')
    ensure.yum.package_installed('python')
    ensure.yum.package_installed('python-devel')
    ensure.supervisord.installed()

@task
def deploy():
    ensure.local_git.up_to_date(against='origin/master')
    ensure.local_git.clean()
    ensure.git.rsync('git@ourgit.example.com:myproject.git', 'myproject', refspec='master', base_dir='git')
    ensure.user_crontab.loaded('git/myproject/user.cron')
    ensure.supervisord.running('git/myproject/supervisord.conf', '/tmp/myproject.supervisord.pid')
    ensure.supervisord.updated_with_latest_config('git/myproject/supervisord.conf')

参考文献

版权所有©2012,Dexter B.Tad-y

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在Android Wifi中筛选相同的SSID?   Java中重写接口中异常处理的泛型   java“无效转义序列(有效的是\b\t\n\f\r\”\“\”\)”语法错误   使用JNDI的java NameReadyBoundException   java如何在这个程序上执行算法   java为什么我的应用程序在调试时崩溃而应用程序停止?   Java:while循环未检测到中断条件,但如果块检测到   java如何快速使用jfreechart创建的折线图   java将输入放入JSTL会话变量,以便稍后在屏幕上显示   java在spring boot中加载外部JAR   java Apache NiFi无法使用ojdbc6连接到Oracle 12c。jar或ojdbc8。罐子   java解释StringToWordVector()Weka的输出   java charAt()找不到符号   使用mpjexpress的java阅读控制台输入