git - 带有 $(GitVersion.NuGetVersion) 的标签源创建带有变量名称而非值的标签

标签 git azure-devops tfsbuild azure-pipelines gitversion

成功构建后,将标签格式配置为 $(GitVersion.NuGetVersion),生成的标签设置为 $(GitVersion.NuGetVersion) 而不是实际的该变量的扩展值。

在构建输出日志记录中,有 2 个部分/计划:构建和完成构建。

据推测,一旦构建代理移动到第二部分/计划,所有变量上下文/状态都将丢失。

如果 GitVersion 变量的上下文在 Finalize Build 部分丢失,我应该如何使用生成的 GitVersion 标记源?

https://github.com/Microsoft/vsts-agent/issues/716

最佳答案

我在 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/

相关文章:

git - 由于引用分支已删除,因此无法获取分支

Git - 撤消 Team Explorer Visual Studio 上的提交

azure-devops - 如何为工作项设置必填字段和默认值

Azure DevOps - 我的自定义版本计数器变量存储在哪里?

Git - 如何使用当前索引(当前状态)的一些未暂存更改来编辑旧的(不是以前的)提交?

git - 严重损坏的 git 存储库

visual-studio - 如何避免在服务器上部署 *.<Environment>.config 转换

tfs - 生成服务器上的Installshield限量版许可

tfs - 如何使用 REST API 列出 TFS GIT 存储库中的所有文件

tfs - 在 TFS 2013 Build 中, "Copy build output to server"究竟将 .zip 文件保存在哪里?