您首选的 php 部署策略是什么?
我正在开始一个 PHP 新项目,我很想从其他开发人员那里获得一些关于他们首选的 PHP 部署策略的反馈.我很想将事情自动化一点,这样一旦提交更改,它们就可以快速迁移到开发或生产服务器.
I'm beginning a new project in PHP and I'd love to get some feedback from other developers on their preferred strategy for PHP deployment. I'd love to automate things a bit so that once changes are committed they can be quickly migrated to a development or production server.
我有使用 Capistrano 和 Ruby 以及一些基本的 shell 脚本进行部署的经验.
I have experience with deployments using Capistrano with Ruby as well as some basic shell scripting.
在我自己开始潜水之前,很高兴听到其他人如何在他们的项目中解决这个问题.
Before I dive head first on my own it would be great to hear how others have approached this in their projects.
目前,开发人员在站点的本地安装上工作,并将更改提交到 subversion 存储库.初始部署是通过从 svn 导出标记版本并将其上传到服务器来进行的.
Currently developers work on local installations of the site and commit changes to a subversion repository. Initial deployments are made by exporting a tagged release from svn and uploading that to the server.
额外的更改通常是通过手动上传更改的文件来逐步完成的.
Additional changes are typically made piecemeal by manually uploading changed files.
推荐答案
对于 PHP、SVN 和 Phing 构建脚本是要走的路.Phing 类似于 ANT 但是是用 PHP 编写的,这使得 PHP 开发人员可以更轻松地修改需要.
For PHP, SVN with Phing build scripts are the way to go. Phing is similar to ANT but is written in PHP, which makes it much easier for PHP developers to modify for their needs.
我们的部署流程如下:
- 每个人在工作时都在同一台本地服务器上进行开发,每个开发人员在他家里的机器上也有一个结账.
- 提交会触发一个提交后挂钩,用于更新临时服务器.
- 测试在临时服务器上运行,如果通过 - 继续.
- Phing 构建脚本已运行:
- 关闭生产服务器,将域切换到正在建设中"页面
- 在生产结帐时运行 SVN 更新
- 运行架构增量脚本
- 运行测试
- 如果测试失败 - 运行回滚脚本
- 如果测试通过,服务器将返回生产结帐
还有 phpUnderControl,这是一个持续集成服务器.老实说,我没有发现它对网络项目很有用.
There's also phpUnderControl, which is a Continuous Integration server. I didn't find it very useful for web projects to be honest.
相关文章