azure-devops - 如何在 Azure DevOps 中将项目版本显示为发布名称
问题描述
我有发布版本pom.xml
。例如,xyz-0.0.1是我的pom.xml
. Azure Build 创建包。
我想在发布管道中使用版本xyz-0.0.1作为发布名称。如何将版本传递给发布管道并在选项中设置“发布名称格式”?
解决方案
因为版本在文件(pom.xml)中,所以不能将版本放在“版本名称格式”中,需要在发布期间从文件中提取版本并分配版本号。
您可以使用 PowerShell 脚本来完成(我编写了这个概念,您需要了解如何准确获取 xml 节点):
$file = Get-Content th/to/pom.xml
# Read the version with something like this:
# $version = Select-Xml -Content $file -XPath "//version"
# Then update the Release name:
Write-Host "##vso[release.updatereleasename]$version"
推荐阅读
- c++ - -Wpadded 警告的例外/排除
- java - 用于 Kafka SQL 的 Java API
- tensorflow - 是否有必要在图像上标记一个类的每个对象?
- r - 如何在我的 R 格式表中为一个单元格着色
- php - 如何删除 .htaccess 文件中的 .php 扩展名?
- amazon-web-services - 如何修复以下云端分发更新错误
- java - 当我们在 java 中创建 Integer 类的实例时会发生什么
- android - 如何在 Unity Split Binary Build 中获得 Application.dataPath 等结果
- android - 如何通过appium执行模拟器命令
- php - 如何ajaxify在后端执行SQL的PHP函数?