未调用 Subversion 提交后
我尝试在每次提交时进行提交后更新我的网站。在 /hooks/post-commit 中,
我做了如下操作
/svnUupdat/cProgrammeThatUpdate >> /log/test.log
好吧,现在如果我尝试
env - ./post-commit
它有效,网站会更新到最后一个版本(并且日志中有一些内容),
但是如果我提交,则不会调用提交后? ? (日志中没有任何内容,并且站点未更新)
请注意,如果我只放入提交后的内容,
/bin/echo "post-commit run" >> /log/test.log
则如果提交某些内容...它可以工作..日志中有一些内容..为什么不调用我的 c 程序?
编辑 我尝试了其他方法,而不是
/usr/bin/svn update /var/www/vhost/xx.com/site1/ >> /var/log/svn/example.log
在日志中调用 ac 程序,我跳过了 /var/www...
为什么它被跳过?如果我在终端中启动 svn 更新,它可以在工作目录中获取最新版本,
谢谢
I tried to do a post-commit to update my website at each commit. in the /hooks/post-commit
I did as follow
/svnUupdat/cProgrammeThatUpdate >> /log/test.log
Ok now if I try that
env - ./post-commit
it works, the website get update to the last revision (and there is something in the log)
but if I commit the post-commit is not called ?? (nothing in the log and the site is not updated)
Note that if I only put in the post-commit
/bin/echo "post-commit run" >> /log/test.log
If a commit something... it works.. there is something in the log.. Why is not calling my c programme then ?
EDIT
I tried something else, that instead of calling a c programm
/usr/bin/svn update /var/www/vhost/xx.com/site1/ >> /var/log/svn/example.log
in the log I have Skipped /var/www...
Why is it skipped ? if i launch the svn update in a terminal it works the working directory get the last revision
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请注意,当 SVN 调用挂钩文件时,它会像未设置环境变量一样执行此操作。因此,您必须在挂钩文件的开头手动设置 PATH 变量。
BEWARE that when SVN calls the hook file, it does so as if no environment variables are set. You will therefore have to manually set the PATH variable at the beginning of your hook file.
“skipped”消息表明 Subversion 无法更新该目录,因为它不是工作副本。但是,这与您可以手动更新目录的说法相冲突。也许您的路径中有一个拼写错误?
您还应该注意,提交后脚本是作为提交的用户执行的。该用户可能与您使用终端时的用户相同,也可能不同。您应该检查提交用户是否具有执行提交后脚本的适当权限,以及该用户是否有权执行您的脚本所做的任何操作。
The 'skipped' message indicates that Subversion cannot update the directory because it's not a working copy. However, this conflicts with your statement that you could update the directory manually. Maybe there's a typo somewhere in your path?
You should also be aware that the post-commit script is executed as the user who is committing. This may or may not be the same user that you are when using the terminal. You should check if the commit user has proper priviledges to execute the post-commit script and if that user has permissions to do whatever your script does.