我正在爲TFS開發幾個自定義構建腳本,我想知道是否有開發,測試和部署TFS構建腳本的最佳實踐。TFS構建腳本的SDLC管理
您是否設置了與生產構建服務器分離的開發和QC環境?還有其他方法可以將腳本與其他構建過程分離開來,以便構建正在開發的腳本不會干擾「生產」構建?
團隊建立喜歡創建工作項目,更新工作項目和添加標籤作爲構建過程的一部分,我寧願不會發生「測試」構建。
JMM這裏
我正在爲TFS開發幾個自定義構建腳本,我想知道是否有開發,測試和部署TFS構建腳本的最佳實踐。TFS構建腳本的SDLC管理
您是否設置了與生產構建服務器分離的開發和QC環境?還有其他方法可以將腳本與其他構建過程分離開來,以便構建正在開發的腳本不會干擾「生產」構建?
團隊建立喜歡創建工作項目,更新工作項目和添加標籤作爲構建過程的一部分,我寧願不會發生「測試」構建。
JMM這裏
看看我的回答是:Modular TeamBuilds
你可以把提取出來成隨機配備在所有建立一個共同的MSBuild文件的核心功能。此外,所有這些文件都是您更廣泛的分支機構的一部分,因此它們無需任何額外的工作即可直接參與您的預先存在的SDLC。因此:
爲了擴大#2,讓我們以「生產」與「測試」版本爲例。您只需打開生產版本中的標籤等功能。所以你可以從TFSBuild.proj中刪除SkipLabel屬性(如果在那裏定義了TFSBuild.Common.targets),而是將它設置在TFSBuild.Production.targets和TFSBuild.Test.targets中 - 當然使用兩個不同的值。
正如前面提到的問題所述,TFSBuild.proj是控制構建的其餘部分如何運行的主要msbuild文件。這裏是我的樣子:
<?xml version="1.0" encoding="utf-8"?>
<!-- DO NOT EDIT the project element - the ToolsVersion specified here does not prevent the solutions
and projects in the SolutionToBuild item group from targeting other versions of the .NET framework.
-->
<Project DefaultTargets="DesktopBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<!-- Import configuration for all MyCompany team builds -->
<Import Project="MyCompany.TeamBuild.Common.targets"/>
<!-- Import build-specific configurations -->
<Import Condition="'$(BuildDefinition)'=='Dev - quick'" Project="MyCompany.TeamBuild.Quick.targets" />
<Import Condition="'$(BuildDefinition)'=='Main - full'" Project="MyCompany.TeamBuild.Full.targets" />
<Import Condition="'$(BuildDefinition)'=='Main - quick'" Project="MyCompany.TeamBuild.Quick.targets" />
<Import Condition="'$(BuildDefinition)'=='Release - full'" Project="MyCompany.TeamBuild.Full.targets" />
<!-- This would be much cleaner as we add more branches, but msbuild doesn't support it :(
Imports are evaluated declaratively at parse-time, before any tasks execute
<Target Name="BeforeEndToEndIteration">
<RegexReplace Input="$(BuildDefinition)" Expression=".*\s-\s" Replacement="">
<Output TaskParameter="Output" PropertyName="BuildType" />
</RegexReplace>
</Target>
<Import Condition="$(BuildType)==full" Project="MyCompany.TeamBuild.Full.targets" />
<Import Condition="$(BuildType)==quick" Project="MyCompany.TeamBuild.Quick.targets" />
-->
</Project>
通過這樣做類似的東西,你可以確保所有從Dev分支版本是「快」建立(這對你意味着沒有標籤,等等),都建立發佈分支是「完整」版本,並且從主分支構建可以取決於用戶從Visual Studio/TSWA啓動的構建定義。我自己,我有「快速」建立與持續集成和「全」建設每晚運行。
我看到你發佈模塊化團隊構建,雖然這是構建構建腳本的極好方法,但我正在尋找關於開發構建腳本的物理過程的幫助。例如,如何防止將不在「生產」中的構建腳本記錄爲生產版本。如果那有意義的話。 jMM – jMM 2009-07-13 16:46:24