代码之家  ›  专栏  ›  技术社区  ›  kosnkov

VST部署多个管道

  •  2
  • kosnkov  · 技术社区  · 7 年前

    是否可以创建一个触发其他管道的管道来组合我的发布定义,这样我就可以通过单击触发所有管道?

    2 回复  |  直到 5 年前
        1
  •  1
  •   Jayendran    7 年前

    是的,你可以 泄放管线 称为 部署前条件 里面有一个菜单叫做 ,在那里你可以 变更/控制

    enter image description here

    更新1

    after environment after release

    enter image description here

        2
  •  2
  •   Marina Liu    7 年前

    若要为多个版本定义创建多个版本,可以通过添加PowerShell任务为不同的版本定义创建版本 REST API .

    创建版本的PowerShell脚本如下所示:

    $body = '
    {
        "definitionId": releasedefinitionID,
         "artifacts": [
            {
    
          "alias": "",
          "instanceReference": {
            "id": "buildID",
            "name": null
          }
    
            }
        ]
    }
    '
    $bodyJson=$body | ConvertFrom-Json
    Write-Output $bodyJson
    $bodyString=$bodyJson | ConvertTo-Json -Depth 100
    Write-Output $bodyString
    $user="name"
    $token="PAT"
    $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$token)))
    
    $Uri = "https://account.vsrm.visualstudio.com/project/_apis/Release/releases?api-version=4.1-preview.6"
    $buildresponse = Invoke-RestMethod -Method Post -UseDefaultCredentials -ContentType application/json -Uri $Uri -Body $bodyString -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)}
    write-host $buildresponse
    
    推荐文章