在过去的十年里,我的windows-fu已经很弱了,而我对azure-pipelines还是个新手。
电子生成器期望在执行发布步骤之前在环境变量CI_BUILD_TAG (或其他几个环境变量)中看到git标记。
在Mac和Linux上,https://stackoverflow.com/a/56576594/681520中描述的方法可以很好地工作:
steps:
- script: CI_BUILD_TAG=`git describe --tags` && echo "##vso[task.setvariable variable=CI_BUILD_TAG]$CI_BUILD_TAG"
displayName: Set the tag name as an environment variable如何在Windows版本中执行此操作?
发布于 2019-09-11 16:06:10
您可以使用PowerShell完成此操作:
steps:
- powershell: |
$CI_BUILD_TAG = git describe --tags
Write-Host "##vso[task.setvariable variable=CI_BUILD_TAG]$CI_BUILD_TAG"
displayName: 'Set the tag name as an environment variable'https://stackoverflow.com/questions/57884530
复制相似问题