2012-01-10 748 views
6

我有jenkins建立任何分支並將其合併到master中。我也有預先接收腳本,以防止任何開發人員檢查主人,除非你是用戶「哈德森」。hudson/jenkins不斷在git中構建壞分支而不是好分支

這是在我們的資料庫中的一個偉大的工作,但是,從另外一個,任何時候有人推一個新的遠程分支,哈德森正在建設一個暫停unworking分支和失敗構建所以每個新推遠程分支會立即觸發構建(post-receive腳本調用curl),但是它會嘗試構建那個糟糕的分支,而不是開發人員推送的分支。

在日誌中注意,它看起來像正確地檢測到dhiller-1是最新推送的,但是後來決定構建dhiller-refactor,它不完整但保存在遠程存儲庫中,因爲它是一個仍然存在的大重構進步(並且僅用於備份目的推)

日誌...

Started by user anonymous 
Checkout:workspace/C:\AAROOT\Jenkins2\jobs\toolbar\workspace - [email protected] 
Using strategy: Default 
Last Built Revision: Revision 597af7a5d808b28f492257f311af9171f03e6891 (origin/dhiller-1) 
Checkout:workspace/C:\AAROOT\Jenkins2\jobs\toolbar\workspace - [email protected] 
Fetching changes from 1 remote Git repository 
Fetching upstream changes from ssh://[email protected]/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 

回答

3

好了,我終於通過完全刪除遠程分支和創建一個新的,從壞的分支有代碼只固定它只是使用一個文件的副本,所以是的我失去了該分支的任何歷史,但它解決了這個問題....這是一個巨大的痛苦,似乎現在再次工作。

0

我有同樣的問題。奇怪的是,詹金斯(Git的-插件)發出的

ERROR: Branch not suitable for integration as it does not merge cleanly

消息,雖然我還沒有檢查「構建之前合併」選項。看看git-plugin here的源代碼,它不得不使用該選項。啓用該選項,保存配置,禁用該選項並再次保存配置,爲我解決了這個問題;它不會再嘗試合併。