VSTS标签源不读取构建阶段输出变量 [英] VSTS Label Sources not reading Build Phase Output Variable

查看:43
本文介绍了VSTS标签源不读取构建阶段输出变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Team Foundation Server的内置标记源功能标记构建,该标记是在构建阶段创建的,并作为输出变量输出.但是,标签源步骤永远不会评估变量,因此该步骤将失败.为什么标签来源步骤无法评估标签变量的值?

I'm trying to tag a build using the built-in, tag sources functionality of team foundation server, the tag is created during the build phase and outputted as an output variable. However the label sources step never evaluates the variable and the step fails. Why does the label sources step not evaluate the value of the tag variable ?

标记源已这样设置

Tag步骤创建并输出标签

The Tag step creates and outputs the tag

变量步骤日志"和"PRINT ENV VARS"都显示了所创建变量的值.

Both the "Tag Step Logs" and the "PRINT ENV VARS" show the value of the variable that is created.

标签源随后由于无法从变量中读取标签值而失败

The label sources then fails as it's not able to read the tag value from the variable

推荐答案

已找到该问题的解决方案.

A solution to the issue has been found.

我正在更新变量Build.BuildNumber并在Tag源中使用它.由于该变量可用于标签来源步骤,因此可以正常工作.

I am updating the variable Build.BuildNumber and using this in the Tag sources. This is working as this variable is available to the label sources step.

我添加了以下行,以更新构建变量

I added the following line, to update the build variable

Write-Host ("##vso[build.updatebuildnumber]$tag")

然后,标签来源步骤使用变量访问此更新的号码 $(Build.BuildNumber)

This updated number is then accessed by the label sources step using the variable $(Build.BuildNumber)

谢谢阿列克谢,找出答案.

这篇关于VSTS标签源不读取构建阶段输出变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆