How to change a tfs build variable in script

北城余情 提交于 2019-12-11 12:53:15

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/35017795/how-to-change-a-tfs-build-variable-in-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!