成功构建后,将标签格式配置为 $(GitVersion.NuGetVersion)
,生成的标签设置为 $(GitVersion.NuGetVersion)
而不是实际的该变量的扩展值。
在构建输出日志记录中,有 2 个部分/计划:构建和完成构建。
据推测,一旦构建代理移动到第二部分/计划,所有变量上下文/状态都将丢失。
如果 GitVersion 变量的上下文在 Finalize Build 部分丢失,我应该如何使用生成的 GitVersion 标记源?
最佳答案
我在 issue on GitHub 中回答了您的问题:
I don't think there is anything we can do inside of the GitVersion task about this as long as VSTS doesn't provide an appropriate API. GitVersion currently just defines the variables using the
##vso[task.setvariable]value
command. Variables are explicitely defined in the task context, and therefor available for subsequent tasks, but not outside of the context.A special case is the build number for which a special command exists
##vso[build.updatebuildnumber]build number
which we are using.A workaround can be to add an additional task which adds the tag, which will work since the task will be in the same context and have therefore access to the variable.
关于git - 带有 $(GitVersion.NuGetVersion) 的标签源创建带有变量名称而非值的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41026158/