2014-11-21 62 views
0

TFSBuild.exe是通過命令行啓動TFS構建的方法。 TFSBuild.exe不指明如何指定Git commit Id(提交的散列)。如何在啓動使用TFSBuild.exe的構建時指定Git Commit id(散列)?

TFSBuild.exe討論了/ getOption:Custom選項,使用時可以使用指定變更集或標籤來建立基礎,方法是使用/ customGetVersion選項指定變更集或標籤標識符。對於標籤,您以「L」開頭。對於變更集,您以「C」開頭。

但是,似乎沒有任何關於如何指定Git commit-id的文檔。

回答

2

使用「Label」語法指定git commit-id,但在提交ID之前添加「G:ref:」。如:/ customGetVersion:LG:REF:

完整的語法:

TFSBuild start teamProjectCollectionUrl teamProject definitionName /queue /getOption:Custom /customGetVersion:LG:ref:<hash> 

實例:

TFSBuild start http://gitsourceserver:8080/tfs/MyCompany MyTeamProject MyBuildDefinition /queue /getOption:Custom /customGetVersion:LG:ref:0c9cc3ce