git推送到gitolite服务器后如何使用post-receive hook?
每次推送到 gitolite 服务器后,我尝试使用 post-receive 挂钩在 Jenkins 上进行新的构建,但推送后它不会自动工作,我需要通过终端手动执行 post-receive 文件来运行它并制作一个建立在詹金斯的基础上。
AFAIK,我需要的是:
修改服务器上的后接收文件以制作我想要的“在 Jenkins 中进行新构建”。
通过命令“git push”将代码推送到 gitolite 服务器。
并且 post-receive 挂钩将在推送过程后自动执行,对吗?
I tried to use post-receive hook to make a new build on Jenkins after every push to the gitolite server, BUT it doesn't work automatically after push and I need to execute post-receive file manually by terminal to run it and make a build on Jenkins.
AFAIK, all I need is to:
Modify the post-receive file on server to make what I want "make a new build in Jenkins".
Push code to the gitolite server by command "git push".
and the post-receive hook will execute automatically after push process, Am I right ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保该文件已设置执行位并且属于 gitolite 用户。还要确保从那里调用每个命令及其完整路径,因为执行挂钩时 PATH 受到限制。
Make shure that the file has the execute bit set and that it belongs to the gitolite user. Also make shure to call each command from there with its full path as PATH is limited while executing the hook.