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

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

问题描述

我正在本地使用 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天全站免登陆