gpt4 book ai didi

linux - 需要 SVN update-commit Hook 帮助

转载 作者:太空宇宙 更新时间:2023-11-04 09:53:55 24 4
gpt4 key购买 nike

我们有一个基于 Linux 的网络服务器 (Media Temple),我们通过他们的 DV 托管解决方案托管多个域。我已经成功地为我们的一个项目创建了 SVN 存储库,但现在我希望它能同步 committ 上的实时 Web 文件夹。 repo 和站点文件都在同一台服务器上...路径如下:

SVN Repo 在这里:/home/svn/repositories/

Live Site 文件在这里:/var/www/vhosts/ /httpdocs/

我可以毫无问题地连接到存储库。实时站点也可以正常工作。现在我只需要让它们同步。

我已经按照指南创建了以下更新文件并正确更新了 POST-COMMIT.tmpl 但仍然没有骰子。 http://www.frenssen.be/content/using-subversion-automatically-update-live-website

这是我的更新程序中的代码:

#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
int main(void)
{
execl("/usr/bin/svn", "svn", "update",
"/var/www/vhosts/<domain>/httpdocs/<subdomain>",
(const char *) NULL);
return(EXIT_FAILURE);
}

我在 POST-COMMIT.tmpl 文件中调用了以下程序:

#!/bin/sh
/home/svn/repositories/autoupdate/autoupdate

知道我遗漏了什么吗?必须有更简单的方法来同步文件吗?

最佳答案

您需要将 post-commit.tmpl 重命名为 post-commit — 即删除 .tmpl 后缀。参见 “Implementing Repository Hooks” from Version Control with Subversion. (.tmpl 文件的命名是为了表明它们是示例,是构建您自己的脚本的模板。)

此外,您引用的指南建议将 Hook 的所有权更改为 apache。它们实际上是指拥有您的存储库的用户(对于指南作者来说显然是 apache)。

关于linux - 需要 SVN update-commit Hook 帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7825583/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com