首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在TFS构建中执行sonar-runner

在TFS构建中执行sonar-runner
EN

Stack Overflow用户
提问于 2013-08-19 19:32:51
回答 2查看 1.6K关注 0票数 2

如何在持续集成的构建TFS (Team Foundation Server)结束时发出运行sonar-runner的命令?信息:TFS2013,Windows Server2008 R2,sonar-runner 2.3

EN

回答 2

Stack Overflow用户

发布于 2013-08-21 03:42:38

在构建过程中执行任意命令的惟一方法是向BuildProcessTemplate添加一个InvokeProcess活动。这并不像乍看起来那么困难。

  1. 复制位于团队项目的/BuildProcessTemplates文件夹中的DefaultTemplate.xaml。你想怎么命名都行--在Visual Studio中折叠或折叠新模板,然后点击右上角的“something.
  2. Open

”,轻松导航到正确的If DropBuild And DropLocation is Set

  1. In to 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 Set
  2. In“Revert Workspace and Copy Files”框中,你将看到一个Copy Files to Drop Location活动。将它从工具箱移到"Else“框中,然后将序列活动从工具箱移到(现在为空) Then框中,然后将
  3. Copy Files to Drop Location (我们之前移动的)移回刚添加到Then框中的Sequence activity中。
  4. 在"Copy Files to Drop Location“activity
  5. Open Properties InvokeProcess活动之后,从工具箱中添加一个活动,以运行。FileName字段是您需要执行的命令。在本例中,是执行Sonar runner的命令。编写一个运行Sonar的批处理或powershell脚本可能是最简单的……然后调用该.tfs。
  6. 保存构建过程模板并将其添加到TFS。然后,您可以在构建definition.

中使用此模板

这种方法的一个问题是,在InvokeProcess命令返回之前,构建不会“完成”。因此,如果你的声纳运行需要很长的时间(我知道我见过一个大型代码库需要超过24个小时),那么构建将永远需要花费很长时间。这可以通过让脚本异步派生Sonar进程来缓解。

票数 2
EN

Stack Overflow用户

发布于 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://vsarguidance.codeplex.com/downloads/get/1452516

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18312759

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档