如何在脚本中更改 tfs 构建变量 [英] How to change a tfs build variable in script

查看:32
本文介绍了如何在脚本中更改 tfs 构建变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 TFS2015 更新 1.我想将信息从一个构建步骤传递到下一个步骤,这怎么可能?

I'm using TFS2015 update 1. I want to pass information from one build step to the next, how is this possible?

这似乎是一项非常简单的任务,但我无法弄清楚它是如何工作的.将变量传递给构建步骤很容易,但将信息从一个步骤传递到下一个步骤似乎是不可能的.我希望我是错的.

That seems like a very simple task, but I can't figure out how that's suppose to work. Passing a variable to a build step is easy, but passing information from one step to the next seems to be impossible. I hope I'm wrong.

推荐答案

您可以致电 task.setvariable Logging Command,在taskcontext的变量服务中设置一个变量.第一个任务可以设置一个变量,后面的任务可以使用这个变量.该变量作为环境变量暴露给以下任务.示例:

You can call the task.setvariable Logging Command, which sets a variable in the variable service of taskcontext. The first task can set a variable, and following tasks are able to use the variable. The variable is exposed to the following tasks as an environment variable. Example:

##vso[task.setvariable variable=testvar;]testvalue

这篇关于如何在脚本中更改 tfs 构建变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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