azure - 有没有办法更改/更新发布管道迭代次数

标签 azure azure-devops tfs azure-pipelines-release-pipeline

我正在尝试使用版本号更改发布管道号,该版本号分为 3 个部分,主要、次要和构建。假设发布管道每次都会更新为“21”、“22”...但我想通过读取该数字来更改此设置,并将其更改为“1.0.0”之类的版本,并且每个版本都会不断增加像主要、次要、构建 + 1 一样运行。

在我试图更改的屏幕截图中突出显示为黄色。

enter image description here

最佳答案

Is there a way to change/update Release pipeline iteration numbers

答案是肯定的。

您可以从发布管道上的选项选项卡更新它:

enter image description here

该值可以是$(major).$(minor).$(rev:r)。该值将为1.0.1

注意:您需要在“变量”选项卡中定义主要次要

enter image description here

Yes $(major).$(minor).$(rev:r) will work definetely but I am trying to update my each Release build as Release-$(major).$(minor).$(rev:r) so that the Release build number should be like Release-1.0.1 . But same while updating it in the json file as version, I want to update only version from that, like 1.0.1 to manifest.json file.

您只需要使用命令行任务简单地处理变量:

 echo $(Release.ReleaseName)

 set  TestVar=$(Release.ReleaseName)

 set MyCustomVar= %TestVar:~8,35%

 echo %MyCustomVar%

关于azure - 有没有办法更改/更新发布管道迭代次数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71260345/

相关文章:

azure - ASP.NET Core - 配置 Application Insight 以与许多应用程序一起使用

node.js - 尝试从 DocumentDb 删除文档时出现错误请求错误

azure - 从 k8s 解析 yaml 配置映射数据

Azure 应用服务计划 |纵向扩展/横向扩展呈灰色

c# - 通过 build.cake 而不是 Azure Devops 发布构建工件

tfs - 查找并删除 csproj 文件中的重复条目

sql-server - 如何让 MSSQL 服务容器在 Azure DevOps 管道中工作?

github - 在 Azure DevOps (Azure Repos) 中镜像所有 GitHub 事件

azure-devops - 如何保留代理的临时文件夹以便从 Azure DevOps 发布管道手动调用命令

c# - TFS 复制工作项链接