如何为Visual Studio Team Services设置CodeDX插件?

时间:2017-11-13 22:38:27

标签: azure-devops azure-pipelines-build-task

我有一个在http://******:82/codedx

运行的CodeDx服务器

这是我的构建任务在VSTS中的外观。 enter image description here

这些是构建的日志: 2017-11-13T22:17:14.6911243Z ============================================================================== 2017-11-13T22:17:14.6911243Z Task : Code Dx - Upload Files 2017-11-13T22:17:14.6911243Z Description : Upload files to Code Dx 2017-11-13T22:17:14.6911243Z Version : 0.1.18 2017-11-13T22:17:14.6911243Z Author : CodeDx 2017-11-13T22:17:14.6911243Z Help : 2017-11-13T22:17:14.6911243Z ============================================================================== 2017-11-13T22:17:14.7536277Z Preparing task execution handler. 2017-11-13T22:17:15.8474356Z Executing the powershell script: C:\agent\_work\_tasks\CodeDxUploadFilse_7a5fadd7-438e-4e37-bba4-aac9d265893c\0.1.18\UploadSourceToCodeDx.ps1 2017-11-13T22:17:15.8630563Z Code Dx URL: http://*******:82/codedx 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z Project ID: 1 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z API key: ********** 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z Paths: C:\agent\_work\4\s\***\****\Controllers\AccountController.cs 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z Source/binaries filenames: 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z Full URL: http://********:82/codedx/api/projects/1/analysis 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z Processing C:\agent\_work\4\s\****\****\Controllers\AccountController.cs as file1... 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z Reading contents of AccountController.cs... 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z Content size: 45983 bytes 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z Building HTTP content... 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z Building request message... 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z Sending source to Code Dx... 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8630563Z 2017-11-13T22:17:15.8942973Z Reading response... 2017-11-13T22:17:15.8942973Z 2017-11-13T22:17:15.8942973Z

2017-11-13T22:17:15.8942973Z Response: {"error":"No appropriate role for file AccountController.cs - it should be removed"}

2017-11-13T22:17:15.8942973Z 2017-11-13T22:17:15.8942973Z 2017-11-13T22:17:15.9411717Z ##[section]Finishing: Code Dx

如何指定将项目下的所有文件扫描到CodeDx?

2 个答案:

答案 0 :(得分:2)

您可以使用zip文件上传源代码。我在构建定义中添加了两个额外的任务:1将源文件存档到zip文件中,1将zip文件上传到Code Dx:

Tasks

归档任务的Archive file to create参数将成为您的Code Dx任务中的Files to upload参数。

存档任务

Archive task

代码Dx任务

enter image description here

答案 1 :(得分:1)

Code Dx接受以下格式的应用程序输入(Built-in Code Scanners):

  1. C / C ++源码zip档案
  2. Java源码zip档案
  3. Java字节码zip存档
  4. .Net source zip archives
  5. .Net Dlls
  6. Ruby on Rails archieves
  7. PHP zip档案
  8. Python zip档案
  9. JavaScript zip档案
  10. Scala zip archives
  11. 您上传不受支持的cs文件,您可以在zip文件中包含源文件(例如.cs)并上传zip文件。