簡體   English   中英

TFS 2015 Rest API-創建內部版本定義

[英]TFS 2015 Rest API - Create Build Definition

我正在嘗試使用他的api rest在TFS中創建一個構建定義。

這是TFS Api Rest的Microsoft文檔

我收到狀態碼200,但是...

這是我查看Tfs構建定義時得到的

有人知道為什么會這樣嗎?

您的第二個鏈接提供了一個截圖,其中包含沒有任務的構建定義。 看來您已經成功創建了一個構建定義,但是沒有在構建定義中添加任務。

檢查您的rest api,看看是否有"build": []參數,其中帶有"task" ,如以下示例所示:

 "build": [
    {
      "enabled": true,
      "continueOnError": false,
      "alwaysRun": false,
      "displayName": "Build solution **\\*.sln",
      "task": {
        "id": "71a9a2d3-a98a-4caa-96ab-affca411ecda",
        "versionSpec": "*"
      },
      "inputs": {
        "solution": "**\\*.sln",
        "msbuildArgs": "",
        "platform": "$(platform)",
        "configuration": "$(config)",
        "clean": "false",
        "restoreNugetPackages": "true",
        "vsLocationMethod": "version",
        "vsVersion": "latest",
        "vsLocation": "",
        "msbuildLocationMethod": "version",
        "msbuildVersion": "latest",
        "msbuildArchitecture": "x86",
        "msbuildLocation": "",
        "logProjectEvents": "true"
      }
    },
    {
      "enabled": true,
      "continueOnError": false,
      "alwaysRun": false,
      "displayName": "Test Assemblies **\\*test*.dll;-:**\\obj\\**",
      "task": {
        "id": "ef087383-ee5e-42c7-9a53-ab56c98420f9",
        "versionSpec": "*"
      },
      "inputs": {
        "testAssembly": "**\\*test*.dll;-:**\\obj\\**",
        "testFiltercriteria": "",
        "runSettingsFile": "",
        "codeCoverageEnabled": "true",
        "otherConsoleOptions": "",
        "vsTestVersion": "14.0",
        "pathtoCustomTestAdapters": ""
      }
    }
  ],

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM