SVN网站开发和部署解决方案 [英] SVN Website Development and Deployment Solution

查看:141
本文介绍了SVN网站开发和部署解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是这样的情况:我们有多个具有不同程度的命令行经验的开发人员,我们正在为我们的网站制定部署解决方案。生产环境是2个SUSE Linux盒子。开发环境也是一个SUSE Linux框。每个开发人员将/将在其主目录中具有SVN树的副本进行开发和测试。



目标是具有易于使用的发布系统,易于恢复,可与多台生产服务器配合使用。如果非网络开发者(仍然是网络世界中的编码器)可以轻松地恢复任何网站,这将是一个奖励。在一个最佳的世界中,发布将像在要发布的网站上运行单个命令一样简单。此命令将更新生产服务器,并在其唤醒中留下一个恢复路径。



我们当前的部署解决方案有点笨重,很难恢复和缓慢的污垢。我们目前使用SVN检查所有文件。然后运行一个基本上在SVN中创建标签的脚本。然后运行第二个脚本,进入每个2个生产服务器,并运行svn up。



任何建议?

解决方案

Capistrano 是一个很好的解决方案。虽然最初是为Ruby on Rails平台开发的,但我已经在许多PHP项目上成功使用了它。它可以自动执行通过SSH执行的操作。部署是原子的,因为每个部署都被签出到一个新的目录。



使用符号链接打开当前的拷贝。源的最新版本是从Subversion中提取出来的。您还可以设置要在生产环境中使用的静态配置文件。



Capistrano还支持回滚,尽管如果您在部署之间进行数据库更改,则必须小心。考虑使用 dbdeploy 或rails 迁移来解决这个问题。


Here is the situation: we have multiple developers with varying degrees of commandline experience and we are putting together a deployment solution for our websites. The production environment is 2 SUSE Linux boxes. The development environment is a SUSE Linux box as well. Each developer has/will have a copy of the SVN tree in their home directory for development and testing.

The goal is to have a release system that is easy to use and easy to revert that will work with multiple production servers. It would be a bonus if a non-web developer (still a coder just not in the web world) could easily revert any of the websites as well. In an optimal world, release would be as simple as running a single command on the website that you want to release. This command would update the production servers and leave a revert path in it's wake.

Our current deployment solution is a bit clunky, quite difficult to revert and slow as dirt. We currently check in all files using SVN. Then a script is run that essentially creates a tag in SVN. A second script is then run that goes onto each of the 2 production servers and runs an 'svn up'.

Any suggestions?

解决方案

Capistrano is a great solution. Although originally developed for the Ruby on Rails platform, I've used it successfully on a number of PHP projects. It automates actions performed via SSH. Deployments are atomic because each deployment is checked out to a new directory.

The current copy is switched on by use of a symbolic link. The latest version of the source is pulled from Subversion. You can also set up static configuration files to use in the production environment.

Capistrano also supports rollbacks, although you have to be careful here if you are making database changes between deployments. Consider using something like dbdeploy or rails migrations to solve this problem.

这篇关于SVN网站开发和部署解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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