如何在持续集成的构建TFS (Team Foundation Server)结束时发出运行sonar-runner的命令?信息:TFS2013,Windows Server2008 R2,sonar-runner 2.3
发布于 2013-08-21 03:42:38
在构建过程中执行任意命令的惟一方法是向BuildProcessTemplate添加一个InvokeProcess活动。这并不像乍看起来那么困难。
”,轻松导航到正确的If DropBuild And DropLocation is Set
Process > Sequence > Run On Agent > Try Compule, Test, and Associate Changesets and Work Items >在Finally子句> Revert Workspace and Copy Files >If DropBuild And DropLocation is SetRevert Workspace and Copy Files”框中,你将看到一个Copy Files to Drop Location活动。将它从工具箱移到"Else“框中,然后将序列活动从工具箱移到(现在为空) Then框中,然后将Copy Files to Drop Location (我们之前移动的)移回刚添加到Then框中的Sequence activity中。FileName字段是您需要执行的命令。在本例中,是执行Sonar runner的命令。编写一个运行Sonar的批处理或powershell脚本可能是最简单的……然后调用该.tfs。中使用此模板
这种方法的一个问题是,在InvokeProcess命令返回之前,构建不会“完成”。因此,如果你的声纳运行需要很长的时间(我知道我见过一个大型代码库需要超过24个小时),那么构建将永远需要花费很长时间。这可以通过让脚本异步派生Sonar进程来缓解。
发布于 2015-05-05 17:13:47
现在有了一种官方方式让MsBuild和TeamBuild与SonarQube合作,这是微软和SonarQube合作的一部分。您可以在SonarQube网站上找到所有详细信息:
http://www.sonarqube.org/announcing-sonarqube-integration-with-msbuild-and-team-build/
在Microsoft ALM网站上:
http://blogs.msdn.com/b/visualstudioalm/archive/2015/04/28/technical-debt-management-announcing-sonarqube-integration-with-msbuild-and-team-build.aspx
还有由ALM rangers准备的文档,其中描述了如何安装SonarQube并将其与现有的TFS服务器集成:
https://stackoverflow.com/questions/18312759
复制相似问题