你最喜欢的php部署策略是什么? [英] What is your preferred php deployment strategy?

查看:97
本文介绍了你最喜欢的php部署策略是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始在PHP开始一个新的项目,我很乐意从其他开发者那里得到他们首选PHP部署策略的反馈。我希望自动化一些事情,以便一旦进行更改,就可以快速迁移到开发或生产服务器。



我有使用Capistrano部署的经验Ruby,以及一些基本的shell脚本。



在我自己潜水前首先了解他们在项目中如何处理这个问题。 >

更多信息



目前,开发人员正在本地安装该站点并对Subversion存储库进行更改。初始部署是通过从svn导出标记的版本并将其上传到服务器来进行的。



通过手动上传更改的文件,其他更改通常会成为零碎的。

解决方案

对于PHP,SVN与 Phing <一个>构建脚本是要走的路。 Phing类似于 ANT ,但是使用PHP编写,这使PHP开发人员更容易根据自己的需要进行修改



我们的部署例程如下:




  • 本地服务器在工作中,每个开发人员在他的机器上都有一个退房回家。

  • 提交触发一个提交后挂钩,更新一个登台服务器。


  • 正在运行Phing构建脚本:

  • 停止生产服务器,切换在正在建设页面的域

  • 在生产结账上运行SVN更新

  • 运行模式增量脚本

  • 运行测试

  • 如果测试失败 - 运行回滚脚本

  • 如果测试通过,服务器路由返回生产结账



还有 phpUnderControl ,它是一个Continuous Integration服务器。我没有发现对于真实的网页项目非常有用。


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.

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.

Further information

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.

解决方案

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.

Our deployment routine is as follows:

  • Everyone develops on the same local server at work, every developer has a checkout on his machine back home as well.
  • Commits trigger a post-commit hook which updates a staging server.
  • Tests are ran on staging server, if they pass - continue.
  • Phing build script is ran:
  • Takes down production server, switching the domain to an "Under construction" page
  • Runs SVN update on production checkout
  • Runs schema deltas script
  • Runs tests
  • If tests fail - run rollback script
  • If tests pass, server routes back to production checkout

There's also phpUnderControl, which is a Continuous Integration server. I didn't find it very useful for web projects to be honest.

这篇关于你最喜欢的php部署策略是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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