想法: 每次推送到git repo时,都应该启动新的Jenkins任务构建。如果更改是:
设置:
问题:
当创建/删除分支时,BitBucket webhook会触发,Jenkins正在处理请求(到目前为止,这么好)。
在Jenkins日志中,我看到: “收到了...的提交挂钩通知”但“BitBucket挂钩日志”屏幕显示以下内容:
Polling SCM changes on master
Using strategy: Default
[poll] Last Built Revision: Revision
.....
.....
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repositories
> git config remote.origin.url ...
Fetching upstream changes from ...
> git --version # timeout=10
using .gitcredentials to set credentials
> git config --local credential.username ....
> git config --local credential.helper store --
> git -c core.askpass=true fetch --tags --progress ... +refs/heads/*:refs/remotes/origin/*
> git config --local --remove-section credential # timeout=10
Polling for changes in
Seen branch in repository ....
Done. Took 6.6 sec
No changes
所以它基本上说没有变化,而且工作没有运行。 如果我进行了代码更改并将更改推送到BitBucket,则作业将按预期启动并且运行正常。
如何强制Jenkins在分支创建/删除时启动新构建?