开发者

What's the best deployment strategy when using Subversion?

I have SVN setup on my local dev box, my live server has only开发者_JAVA技巧 outbound svn only. What's the best way to upload or commit the changes only to the live server. I have to upload the whole code base now. I don't like to follow the way anymore. Please suggest me a good way to have updates committed or uploaded to the live server.

Thank you.


If you can't touch the Subversion server instance on your production server, you have a couple of options:

  • Publish the code elsewhere, then use the Subversion client on your production server to pull down a copy of the code from the published location. (Make sure you use svn export, not svn checkout, so that you don't get .svn directories scattered all over, or else protect your .svn directories in some way.)

  • Use a post-commit hook on your local development environment to push the code to the server (for example, via FTP). Every time you commit, you'll trigger a push to production. You'll probably want something more fine-grained -- for example, a common practice is to trigger this push whenever a tag is committed that includes the word "release".


If you're not going to use

svn export

make sure that your .svn directories are not web accessible. Otherwise one could potentially obtain your source code via the SVN files.


<IfModule mod_rewrite.c>
  RewriteRule ^(.*/)?\.svn/ - [F,L]
  ErrorDocument 403 "Access Forbidden"
</IfModule>


I don't get the "outbound" SVN only but SVN over HTTP using Apache is working fine for my configuration. Most tutorials out there will get you started in minutes.

The rest are "easy", if you are familiar with SVN.


You could use a post-commit hook to trigger an svn export.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜