gpt4 book ai didi

azure-devops - Azure DevOps API 发布定义

转载 作者:行者123 更新时间:2023-12-01 21:56:45 25 4
gpt4 key购买 nike

尝试从其他项目复制发布模板时出现以下错误

"VS402982: A retention policy is not set for the stage ‘PROJECT-ENV’. Retention policies at the release pipeline level are deprecated.

{
"id": 8,
"name": "PROJECT-ENV",
"rank": 1,
"owner": "@{displayName=Zoe MacKay; _links=; id=; uniqueName=Zoe.MacKay;imageUrl=https://dev.azure.com/incrementalgroup/_apis/GraphProfile/MemberAvatars/}",
"variables": "",
"variableGroups": "",
"preDeployApprovals": "@{approvals=System.Object[]; approvalOptions=}",
"deployStep": "@{id=27}",
"postDeployApprovals": "@{approvals=System.Object[]; approvalOptions=}",
"deployPhases": "",
"environmentOptions": "@{emailNotificationType=OnlyOnFailure; emailRecipients=release.environment.owner;release.creator; skipArtifactsDownload=False; timeoutInMinutes=0; enableAccessToken=False; publishDeploymentStatus=True; badgeEnabled=False; autoLinkWorkItems=False; pullRequestDeploymentEnabled=False}",
"demands": "",
"conditions": "",
"executionPolicy": "@{concurrencyCount=1; queueDepthCount=0}",
"schedules": "",
"currentRelease": "@{id=70; url=https://vsrm.dev.azure.com/; _links=}",
"retentionPolicy": "@{daysToKeep=30; releasesToKeep=3; retainBuild=True}",
"processParameters": "",
"properties": "",
"preDeploymentGates": "@{id=0; gatesOptions=; gates=System.Object[]}",
"postDeploymentGates": "@{id=0; approvals:[]; gatesOptions=; gates=System.Object[]}",
"environmentTriggers": ""
},

从当前版本复制。

最佳答案

您的 JSON 无效。您需要确保正确展开所有嵌套值。例如:

"retentionPolicy":  "@{daysToKeep=30; releasesToKeep=3; retainBuild=True}",

应该是

"retentionPolicy": {
"daysToKeep" : 30,
"releasesToKeep": 3,
"retainBuild": true
},

如果您使用 PowerShell 创建此 JSON,请确保指定 Depth 参数,以便它正确扩展每个值。

关于azure-devops - Azure DevOps API 发布定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56360972/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com