TFS 2015构建:可以在存储库映射中使用变量吗? [英] TFS 2015 builds : Is it possible to use Variables in Repository mappings?

查看:42
本文介绍了TFS 2015构建:可以在存储库映射中使用变量吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在TFS 2015上创建vNext构建时,您可以定义变量,然后在构建步骤中使用这些变量,还可以在构建运行的脚本中将其用作环境变量。

When creating a vNext build on TFS 2015 you can define variables, which are then used in build steps, and can also be used as environment variables in scripts the build runs.

我正在处理的构建运行脚本,该脚本从映射位置提取文件,因此,如果我可以定义一个变量并将其用于映射中,那将是很好的选择,例如,如果我在项目中更新了引用,在构建时,我可以简单地用新位置更新变量,并使存储库映射和脚本都从新位置正确提取,而不必在多个位置进行更改。

The build I am working on runs scripts that pulls files from mapped locations, so it would be great if I could define a variable and use it in a mapping so that for example, if I update a reference in the project the build is building, I can simply update the variable with the new location and have the repository mappings and scripts all pull correctly from the new location without having to make the change in multiple places.

我尝试通过如下设置变量和映射来做到这一点,


但是,当您尝试保存构建而抱怨映射中有两个 $字符时,这会产生错误。

I have tried doing this by setting up the variable and mapping as follows, But this generates an error when you try to save the build complaining that there are two '$' characters in the mapping. Is there way to do this or is this not currently possible?

推荐答案

这是不可能的。就像错误消息中提到的那样:映射中有两个 $字符。这意味着您的应用程序的路径不应因构建而异。

It's impossible. Just as the error message mentioned: there are two '$' characters in the mapping. Which means your application's path shouldn't vary from build to build.


存储库页面上的映射用于指定源代码控制
文件夹,该文件夹包含需要在build $中构建的项目b $ b的定义。您可以通过单击省略号(...)按钮来设置它,但是
不能在映射路径中包含变量。

Mappings on the Repository page are used to specify source control folder which contains projects that need to be built in the build definition. You can set it via clicking the Ellipsis (...) button, however, you can't include variables in the mapping path.

有一个类似的问题:变量在Visual Studio Online团队构建上的TFS映射中

这篇关于TFS 2015构建:可以在存储库映射中使用变量吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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