开发者

How to implement svn's post-commit hook to automate the deployment of php web projects?

This is the default stuff in post-commit.tmpl, which I think does nothing useful:

REPOS="$1"
REV="$2"

mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf

How can I make use of this h开发者_运维百科ook to automate the deployment?


The post-commit hook is called on the server-side in the repository, which is a database, so you won't be able to do much from such a hook.

So just do your deployment from your working copy, after your commit. The easiest is to make a script for this, and of course make it also under version control.

If you're on Windows, there's a nice tool shipped with TortoiseSVN called SuvWCRev that you can integrate from your script. It allows you to retrieve all your working copy information so that the thing you deploy have somewhere the trace of what revision it was made from, and other useful stuff.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜