[英]What's the best process / app for automated deployment of PHP apps?
There's another post on SO relating to .NET -- not us. 关于.NET的另一篇文章与.NET有关 - 而不是我们。 Pure PHP. 纯PHP。 Trying to find the best way/process to deploy stable version of our PHP app. 试图找到部署PHP应用程序稳定版本的最佳方法/流程。 I've seen an article on Capistrano , but am curious what else is out there. 我见过一篇关于卡皮斯特拉诺的文章,但很好奇还有什么在那里。 Aside from the obvious reasons, I'm also looking to add some scripting so that the SVN rev number gets added in there as well . 除了显而易见的原因,我还想添加一些脚本,以便在那里添加SVN转数 。
Much thanks. 非常感谢。
I've used a home-grown script for quite some time. 我已经使用了一个本土的脚本很长一段时间了。 It will (based on an application configuration file): 它将(基于应用程序配置文件):
svn export
on the repository based on a tag. 基于标记在存储库上运行svn export
。 scp
to copy the package to the appropriate server (QA or release). 使用scp
将程序包复制到适当的服务器(QA或发行版)。 ssh
to install the package and run post-install scripts. 使用ssh
连接到服务器以安装软件包并运行安装后脚本。 The application configuration file is part of the project. 应用程序配置文件是项目的一部分。 It can tell the script (at step 2) to strip paths and otherwise process specified files. 它可以告诉脚本(在步骤2)剥离路径并以其他方式处理指定的文件。 It also specifies server names and how to handle externals. 它还指定服务器名称以及如何处理外部。
I've recently migrated the script to support Git as well as Subversion. 我最近迁移了脚本以支持Git和Subversion。 I'm also probably going to migrate it to PHP since we're now running in a mixed (Linux and Windows) set up, with Linux now in the minority. 我也可能将它迁移到PHP,因为我们现在运行的是混合(Linux和Windows)设置,而Linux现在只占少数。
I have plans to automatically call the script with post-commit hooks, but haven't had the need to implement that just yet. 我计划使用post-commit钩子自动调用脚本,但还没有必要实现它。
Coincidentally, I was just reading about an Apache Ant/gnu make like build tool called Phing . 巧合的是,我刚刚读到了一个名为Phing的Apache Ant / gnu make构建工具。 What I like about it is the ability to write custom extensions in PHP! 我喜欢它的是用PHP编写自定义扩展的能力!
We're using Webistrano , which is a web frontend for Capistrano, to deploy a few dozen projects. 我们正在使用Webistrano ,这是Capistrano的网络前端,可以部署几十个项目。 It's built as a Ruby on Rails app, and provides a nice, centralized and consistent user interface for Capistrano deployments. 它是作为Ruby on Rails应用程序构建的,为Capistrano部署提供了一个漂亮,集中且一致的用户界面。
Instead of having cap recipes in every project, and running command-line tools, Webistrano stores the recipes in its database, and allows you to attach the recipes to multiple projects and stages. Webistrano不是在每个项目中都有封面配方,而是运行命令行工具,而是将配方存储在其数据库中,并允许您将配方附加到多个项目和阶段。 This reduces duplication of scripts. 这减少了脚本的重复。
Also nice is that all deployment logs are stored so there's an auditing trail. 同样很好的是存储了所有部署日志,因此存在审计跟踪。 Who deployed which revision to the live server, that sort of thing. 是谁在实时服务器上部署了哪个版本。
As you requested, the Revision number is stored in the deployed project as well. 根据您的要求,修订号也存储在已部署的项目中。
All in all, we're very pleased with it. 总而言之,我们对它非常满意。
I don't know if it works for deploying an app live, but phpUnderControl is a continuous integration suite (which I'm just now starting to look into). 我不知道它是否适用于部署应用程序,但phpUnderControl是一个持续集成套件(我现在才开始研究)。 If it doesn't support doing deployments natively, it can probably be extended to do them. 如果它本身不支持进行部署,则可以扩展它们以进行部署。
Chris Hartjes对此有一个很好的看法: 部署不是一个4个字母的单词
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.