Azure DevOps Pipelines Environments中的“状态”值使用内部版本号的初始值,然后在使用gitversion.yml进行构建期间对其进行转换
我的构建管道YAML始于:
name: $(GITVERSION_MAJOR).$(GITVERSION_MINOR).$(GITVERSION_PATCH).$(Build.BuildId)$(GITVERSION_PRERELEASELABEL)
当构建开始时,Azure DevOps临时显示为:
#$(GITVERSION_MAJOR).$(GITVERSION_MINOR).$(GITVERSION_PATCH).64890$(GITVERSION_PRERELEASELABEL)
在构建期间,运行的第一个任务是GitVersion任务:
- task: gittools.gitversion.gitversion-task.GitVersion@4
displayName: GitVersion
inputs:
updateAssemblyInfo: true
preferBundledVersion: false
使用以下已检入存储库的gitversion.yml:
mode: ContinuousDeployment
continuous-delivery-fallback-tag: ''
branches:
master:
mode: ContinuousDeployment
tag: '-dev'
increment: Minor
track-merge-target: true
tracks-release-branches: true
is-release-branch: false
prevent-increment-of-merged-branch-version: false
release:
regex: release?[/]
mode: ContinuousDeployment
increment: Minor
tag: ''
is-release-branch: true
prevent-increment-of-merged-branch-version: true
feature:
regex: feature?[/]
mode: ContinuousDeployment
increment: Inherit
tag: '-alpha'
is-release-branch: false
prevent-increment-of-merged-branch-version: true
pull-request:
mode: ContinuousDeployment
tag: '-pr'
ignore:
sha: []
运行之后,正在进行的构建名称会自动更新为:
1.24.0.64890-alpha
但是,在Azure DevOps的“环境”部分中,未进行此更改,其状态仍为:
Deployment by $(GITVERSION_MAJOR).$(GITVERSION_MINOR).$(GITVERSION_PATCH).64878$(GITVERSION_PRERELEASELABEL)
我希望“状态”设置为“ 1.24.0.64890-alpha”,与管道“上次运行”列中显示的内容相同。