你如何管理你的构​​建[使用Phing]进程? [英] How do you manage your build [using Phing] process?

查看:153
本文介绍了你如何管理你的构​​建[使用Phing]进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用Phing自动:

I'm trying to use Phing to automate :


  • 运行测试

  • 每个开发人员的机器上运行数据库迁移[使用dbdeply]

  • 在需要时部署到生产

我觉得它确实是有意义的在我的项目中添加一个build文件夹,并把我所有的构建配置文件和数据库的增量文件夹中。并提交所有进入SVN仓库。所以每一个开发者会得到时,他退房从SVN更新版本的文件。并能够运行构建有了新的变化来更新自己的数据库。

I think it does make sense to add a build folder in my project and put all my build configuration files and db deltas in that folder. and commit all that into the SVN repository. so every developer will get the updated build files when he check-out from svn. and be able to run the build to update his DB with the new changes.

在生产服务器上:
我正打算再添构建文件那里得到在SVN最新版本的标签并执行CSS和放大器; JS COM pression。

on the production server: I was planning to add another build file there to get the latest Tagged version in svn and perform CSS & JS compression.

我正打算继续实施整合使用PHPUnderControl了,所以我可以保持每个构建的结果跟踪和获得通知每当构建失败。

I was planning to implement continues integration using PHPUnderControl too, so I can keep track of the result of each build and get notified whenever the build fails.

那么,你认为这一切都意义,或者你有其他更好的建议?

so, do you think this all does make sense, or you do have other better suggestions?

推荐答案

你说的是有道理的:它是pretty接近我经常使用的(有时蚂蚁,有时phing,有时用一些外壳脚本)

What you say makes sense : it's pretty close to what I often use (sometimes with ant, sometimes with phing, and sometimes with some shell-scripts).

构建目录,我想有这样的事情:

In the build directory, I would have something like this :

build/
    testing/
    development/
    staging/
    production/
    common/

在每个子目录有一个的build.xml 文件 - 包括所有其他的build.xml 文件,位于通用目录,其用意就是把尽可能多的常用code尽可能在普通的build.xml 文件,并有每个环境的具体文件,它们包含尽可能少的XML code越好。

With one build.xml file in each sub-directory -- all including another build.xml file, located in the common directory, the idea being to put as much "common" code as possible in the "common" build.xml file, and to have per-environment specific files, that contain as few xml code as possible.

这可以与 <$ C $完成C>导入 存在于phing <上一个版本的任务EM>(不知道它在稳定版本 - 我使用phing的SVN结帐,有这一个,该项目我目前工作)的

结果
有一件事,但:你说你要部署到从生产服务器生产;我宁愿,而不是:


One thing, though : you say you want to deploy to production from the production server ; I would rather, instead :


  • 发展的服务器上:

    • 从SVN出口

    • COM preSS JS / CSS和所有

    • 创建一个tar.gz压缩


    • 取消-COM的上载档案preSS

    • 改变一对夫妇符号连接使用的源的新版本(见我给<一个答案href=\"http://stackoverflow.com/questions/1395992/updating-a-web-app-without-any-downtime/1396015#1396015\">here,对于更多的信息)

    • 更新有什么在DB做

    • un-compress that uploaded archive
    • change a couple of symlink to use the new version of the sources (see the answer I gave here, for more informations)
    • update what has to be done in the DB

    这个想法是为:


    • 请尽可能少的事情尽量在生产服务器上

      • 以防万一出错

      • 在的情况下,有一天,你的生产服务器无法访问SVN服务器

      结果
      哦,还有,作为一个阿里纳斯:你必须写某种如何部署到生产的文档,一步一步


      Oh, and, as a sidenote : you have to write some kind of documentation of "how to deploy to production", step by step !

      这将是非常有用的你是在假期,别人有部署到生产,因为一个紧急漏洞修复的一天; - )

      This will be really useful the day you are in holiday and someone else has to deploy to production because of an urgent bug-fix ;-)

      这篇关于你如何管理你的构​​建[使用Phing]进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆