2011-03-28 32 views
13

我想將整個項目的歷史自成立以來一直載入聲納。如何使用Sonar重新分析項目的完整歷史記錄?

我基本上要這樣執行代碼:

 
0) checkout version 1 from Subversion 
1) checkout next version from Subversion 
2) if the commit date is from the same day as the previous one - goto 1 
3) run mvn sonar:sonar, overriding the build time with the time of the commit 
4) if not on last commit - goto 1 

是否有一個工具,它已經做了這個?有沒有一種說服聲納使用與現在不同的日期的方法?

+1

我有同樣的問題,我對與「sonar.projectDate」劇本很感興趣。你寫了這個劇本嗎?在此先感謝 – Pith 2012-05-21 07:38:37

回答

12

這是從郵件列表:

事實上,導入歷史數據,你必須使用 「sonar.projectDate」 屬性(格式爲YYYY-MM-DD,例如2010-12-25)[1 ]並對您希望在項目歷史記錄中看到的每個標籤/分支啓動聲納分析。

http://sonarqube.15.x6.nabble.com/re-ordering-historical-data-td3191565.html

有一個額外的Blogpost,說明這一點進一步。

+0

斷開的鏈接! : -/ – Peteter 2013-09-27 08:38:48

+0

http://www.sonarqube.org/sonar-time-machine-replaying-the-past/ – Peteter 2013-09-27 08:40:20

1

我只是在尋找這個確切的同樣的事情,發現在GitHub的一個方便的bash腳本:

https://gist.github.com/aslakknutsen/2422117

腳本就每個標籤的結帳(從給出的參數的特定標籤開始) ,將標記日期設置爲sonar.projectDate並對其執行聲納分析。非常便利。我想我可能需要稍微修改一下,因爲我們沒有那麼多的回購標籤,也許每週都會進行分析等等。

相關問題