如何实现svn的post-commit hook来自动化部署php web项目?

发布于 2024-09-04 15:09:37 字数 196 浏览 1 评论 0原文

这是 post-commit.tmpl 中的默认内容,我认为它没有任何用处:

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

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

How can I make use of this hook to自动化部署?

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 hook to automate the deployment?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你爱我像她 2024-09-11 15:09:37

提交后挂钩在存储库的服务器端调用,存储库是一个数据库,因此您无法通过这样的挂钩执行太多操作。

因此,只需在提交后从工作副本进行部署即可。最简单的方法是为此制作一个脚本,当然也将其置于版本控制之下。

如果您使用的是 Windows,TortoiseSVN 附带了一个不错的工具,名为 SuvWCRev 您可以从脚本中集成。它允许您检索所有工作副本信息,以便您部署的内容在某个地方可以跟踪它的修订版以及其他有用的内容。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文