提交后钩子以 svn 中的用户身份运行
Apache 在 Windows 机器上以 SYSTEM 身份运行。
post-commit.bat 应该使用什么用户和密码?
我正在尝试将内容复制到目录以在网络服务器上的开发人员版本上进行测试,但似乎无法正常工作。
Apache on a windows machine running as SYSTEM.
What user and password should be used for a post-commit.bat?
I am trying to copy content to a directory for testing on a developer version on the webserver and don't seem to have it working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
挂钩脚本将由服务器启动,因此您只需确保相应的用户(您的系统)具有
取决于根据您的脚本的功能,您可能需要更多信息,例如它是否创建日志 - 如果它通常访问其他资源。这可能是您遇到的问题。
另外,如果钩子脚本是.bat,则需要
COMSPEC
环境变量来查找shell(我在Windows XP中遇到了这个问题,这主要是由于配置错误)。该变量通常定义为C:\Windows\system32\cmd.exe
。PATH
当然也非常重要。请注意,这可能会产生误导,当您使用另一个用户登录测试脚本时,您可能拥有服务器身份所没有的其他访问权限。
编辑:如果您不确定,可以在批处理脚本的开头设置或扩展重要的环境变量,例如
PATH
和COMSPEC
它们包含服务器帐户的内容。例如,有时比在黑暗中尝试修改服务器帐户更容易。
The hook scripts will be launched by the server, so you only need to make sure the corresponding user (SYSTEM for you) has
Depending on what your script does, you may need more, for example if it creates a log - if it accesses other resources in general. That's probably the problem you have encountered.
Also, if the hook script is a .bat, the
COMSPEC
environment variable is needed to find the shell (I had this problem with Windows XP, it was mainly due to a bad configuration). This variable is typically defined asC:\Windows\system32\cmd.exe
.PATH
is also very important of course.Note that it could be misleading, when you test the script with another user login you may have another access your server identity won't.
Edit: It is possible to set or expand important environment variables like
PATH
andCOMSPEC
at the beginning of the batch script, if you are not sure what they contain with the server account. For example,Sometimes it is easier than being in the dark and trying to modify the server's account.