【发布时间】:2012-01-10 14:28:00
【问题描述】:
我已经设置了 jenkins 来构建任何分支并将其合并到 master 中。我也有预接收脚本,以防止任何开发人员签入 master,除非您是用户“hudson”。
它在我们的一个存储库中运行良好,但在另一个存储库中,每当有人推送新的远程分支时,hudson 都会构建一个暂停的未工作分支并且构建失败,因此每次新推送远程分支都会触发立即构建( post-receive 脚本调用 curl) 但随后它尝试构建那个坏分支而不是开发人员推送的那个。
在日志中注意,看起来它正确检测到 dhiller-1 是最新推送的,但随后决定构建 dhiller-refactor,它不完整但保留在远程存储库中,因为它是一个仍在进行中的大型重构(并且仅出于备份目的推送)
日志...
Started by user anonymous
Checkout:workspace / C:\AAROOT\Jenkins2\jobs\toolbar\workspace - hudson.remoting.LocalChannel@aab87f
Using strategy: Default
Last Built Revision: Revision 597af7a5d808b28f492257f311af9171f03e6891 (origin/dhiller-1)
Checkout:workspace / C:\AAROOT\Jenkins2\jobs\toolbar\workspace - hudson.remoting.LocalChannel@aab87f
Fetching changes from 1 remote Git repository
Fetching upstream changes from ssh://hudson@192.168.111.130/opt/toolbar
Seen branch in repository origin/HEAD
Seen branch in repository origin/dhiller-1
Seen branch in repository origin/dhiller-2
Seen branch in repository origin/dhiller-refactor
Seen branch in repository origin/dhiller-test
Seen branch in repository origin/master
Commencing build of Revision 2c56d8645871ea2929c717e15038a5b79c0b43e1 (origin/dhiller-refactor)
Merging Revision 2c56d8645871ea2929c717e15038a5b79c0b43e1 (origin/dhiller-refactor) onto master
ERROR: Branch not suitable for integration as it does not merge cleanly
Build did not succeed and the project is configured to only push after a successful build, so no pushing will occur.
Finished: FAILURE
【问题讨论】: