I don't think that our method can be called best practice, but it has served us well.
We have several large databases for our application (20gb+), so maintaining local copies on each developers computer has never really been an option, and even though we don't develop against the live database, we do need to do the development against a database that is as close to the real thing as possible.
As a consequence we use a central web server as well, and keep a development branch of our subversion trunk on it. Generally we don't work on the same part of the system at once, but when we do need to do that, or someone is making a lot of substantial changes, we branch the trunk and create a new vhost on the dev server.
We also have a checkout of the code on the production servers, so after we're finished testing we simply do a svn update on the production servers. We've implemented a script that executes the update command on all servers using ssh. This is extremely convinient, since our code base is large and takes a lot of time to upload. Subversion will only copy the files that actually have been changed, so it's a lot faster.
This has worked really well for us, and the only thing to watch out for is making changes on the production servers directly (which of course is a no-no from the beginning) since it might cause conflicts when updating.
I never thought about having a repository copy on the server. After reading it, I thought it might be cool... However, updating the files directly in the live environment without testing is not a great idea.
You should always update a secondary environment matching exactly the live one (webserver + DB version, if any) and test there. If everything goes well, then put the live site under maintenance, update files, and go live again.
So I wouldn't make the live site a copy of the repository, but you could do so with the test env. You'll save SSH + compressing time, plus you can check out any specific revision you'd like to test.
Capistrano is great. The default recipes The documentation is spotty, but the mailing list is active, and getting it set up is pretty easy. Are you running Rails? It has some neat built-in stuff for Rails apps, but is also used fairly frequently with other types of webapps.
There's also Webistrano, which is based on Capistrano but has a web front-end. Haven't used it myself. Another deployment system that seems to be gaining some traction, at least among Rails users, is Vlad the Deployer.
发布评论
评论(3)
我不认为我们的方法可以称为最佳实践,但它对我们很有帮助。
我们的应用程序有几个大型数据库(20GB+),因此在每台开发人员计算机上维护本地副本从来都不是一个真正的选择,即使我们不针对实时数据库进行开发,我们也确实需要针对数据库进行开发这尽可能接近真实的东西。
因此,我们也使用中央 Web 服务器,并在其上保留 Subversion 主干的开发分支。 一般来说,我们不会同时处理系统的同一部分,但当我们确实需要这样做时,或者有人正在进行大量实质性更改时,我们会对主干进行分支并在开发服务器上创建一个新的虚拟主机。
我们还在生产服务器上检查了代码,因此在完成测试后,我们只需在生产服务器上执行 svn 更新即可。 我们已经实现了一个使用 ssh 在所有服务器上执行更新命令的脚本。 这非常方便,因为我们的代码库很大并且需要很多时间来上传。 Subversion 只会复制实际已更改的文件,因此速度要快得多。
这对我们来说非常有效,唯一需要注意的是直接在生产服务器上进行更改(这当然从一开始就是禁忌),因为它可能会在更新时引起冲突。
I don't think that our method can be called best practice, but it has served us well.
We have several large databases for our application (20gb+), so maintaining local copies on each developers computer has never really been an option, and even though we don't develop against the live database, we do need to do the development against a database that is as close to the real thing as possible.
As a consequence we use a central web server as well, and keep a development branch of our subversion trunk on it. Generally we don't work on the same part of the system at once, but when we do need to do that, or someone is making a lot of substantial changes, we branch the trunk and create a new vhost on the dev server.
We also have a checkout of the code on the production servers, so after we're finished testing we simply do a svn update on the production servers. We've implemented a script that executes the update command on all servers using ssh. This is extremely convinient, since our code base is large and takes a lot of time to upload. Subversion will only copy the files that actually have been changed, so it's a lot faster.
This has worked really well for us, and the only thing to watch out for is making changes on the production servers directly (which of course is a no-no from the beginning) since it might cause conflicts when updating.
我从来没有想过在服务器上有一个存储库副本。 读完之后,我觉得这可能很酷……但是,不进行测试而直接在实时环境中更新文件并不是一个好主意。
您应该始终更新与当前环境完全匹配的辅助环境(网络服务器 + 数据库版本,如果有)并在那里进行测试。 如果一切顺利,则对上线站点进行维护,更新文件,然后再次上线。
因此,我不会将实时站点设为存储库的副本,但您可以使用测试环境来实现此目的。 您将节省 SSH + 压缩时间,此外您还可以查看您想要测试的任何特定修订版。
I never thought about having a repository copy on the server. After reading it, I thought it might be cool... However, updating the files directly in the live environment without testing is not a great idea.
You should always update a secondary environment matching exactly the live one (webserver + DB version, if any) and test there. If everything goes well, then put the live site under maintenance, update files, and go live again.
So I wouldn't make the live site a copy of the repository, but you could do so with the test env. You'll save SSH + compressing time, plus you can check out any specific revision you'd like to test.
卡皮斯特拉诺很棒。 默认食谱 文档参差不齐,但邮件列表是活跃的,并且设置它非常容易。 你正在运行 Rails 吗? 它为 Rails 应用程序提供了一些简洁的内置内容,但也经常与其他类型的 Web 应用程序一起使用。
还有 Webistrano,它基于 Capistrano,但是有一个网络前端。 我自己没用过。 另一个似乎获得了一些关注的部署系统(至少在 Rails 用户中)是 Vlad the Deployer。
Capistrano is great. The default recipes The documentation is spotty, but the mailing list is active, and getting it set up is pretty easy. Are you running Rails? It has some neat built-in stuff for Rails apps, but is also used fairly frequently with other types of webapps.
There's also Webistrano, which is based on Capistrano but has a web front-end. Haven't used it myself. Another deployment system that seems to be gaining some traction, at least among Rails users, is Vlad the Deployer.