gpt4 book ai didi

azure - 通过 Azure CLI 推送通用发布工件(az 工件通用发布)

转载 作者:行者123 更新时间:2023-12-02 06:36:27 25 4
gpt4 key购买 nike

我正在使用这个命令:

az artifacts universal publish --organization https://dev.azure.com/project/ --project="myProject" --scope project --feed myFeed --name someName --version 0.0.2 --description "some files" --path .

将另一个包上传到 feed。问题是我每次都需要更新版本。有没有办法让命令在下一个补丁中自动更新?

我知道可以通过管道实现:

versionOption: 'patch'

在 Azure CLI 上执行同样的操作会很棒

最佳答案

不支持直接使用 Azure CLI 发布通用包命令更新版本。

满足您需求的解决方案:

准备一个本地.txt文件“C:\temp\File.txt”,其中包含初始版本值“0.0.1”。

每次使用以下 PowerShell 命令更新版本。

$file = "C:\temp\File.txt"
$fileVersion = [version](Get-Content $file | Select -First 1)
$newVersion = "{0}.{1}.{2}" -f $fileVersion.Major, $fileVersion.Minor, ($fileVersion.Build + 1)
$newVersion | Set-Content $file

enter image description here

并在 Azure CLI 命令中使用 newVersion 的值。

这是示例:

az artifacts universal publish --organization https://dev.azure.com/project/ --project="myProject" --scope project --feed myFeed --name someName --version $newVersion --description "some files" --path .

关于azure - 通过 Azure CLI 推送通用发布工件(az 工件通用发布),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73216719/

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