【发布时间】:2015-04-03 15:30:33
【问题描述】:
我已经在 windows 机器上安装了 Jenkins,用 git repo 配置了一个项目。我的目标是当有人提交到 github 时自动构建项目。为了实现这个目标,我更新了 .git/hooks 目录下的“Post-Receive”(无 extn)文件。 代码如下所示
#!/bin/bash
curl http://localhost:9090/job/MyProject/build?token=mytoken
当我执行curl http://localhost:9090/job/MyProject/build?token=mytoken 命令或sh post-receive 时,jenkins 作业将触发。
当我将更改推送到 git repo(从另一台机器)中时,不会触发 Jenkins 作业。请分享您的想法,这将有助于我解决此问题。
【问题讨论】: