在两个代理阶段之间传递释放变量 [英] Passing release variables between two agent phases

查看:51
本文介绍了在两个代理阶段之间传递释放变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在内部使用TFS. 我的问题是,在发布期间,我有两个代理阶段,由人工干预分隔.

I'm working with TFS on-premise. My issue is that during a release I have two agent phases separated by a manual intervention.

在第一个代理阶段,我使用以下命令设置变量:

In the first agent phase, I set a variable with:

Write-Verbose $("##vso[task.setvariable variable={0};]{1}" -f $variablename, $variable)

问题在于,即使在第二发布阶段使用了相同的代理,在第二个代理阶段也不再存在该变量.

Problem is that in the second agent phase, this variable doesn't exist anymore, even if the same agent is used for the second release phase.

如何在同一发行版的两个代理阶段之间传递变量?

How may I pass a variable between two agent phases during the same release?

推荐答案

没有办法持久存储变量(无论Powershell变量还是VSTS用户定义的变量)两个代理阶段之间的(和环境).

There is no way to persist variables (no matter powershell variables or VSTS user defined variables) between two agent phases (and environments) for now.

还有一个相关问题通过日志记录命令设置的变量在代理之间不是持久的,您可以跟进.

And there is a related issue Variables set via logging commands are not persistent between agents, you can follow up.

目前的解决方法是在下一个代理阶段再次定义变量.

The work around for now is define the variable again in next agent phase.

这篇关于在两个代理阶段之间传递释放变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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