如何在 TFS Build 2010 中进行构建定义,可配置 wrt 输入变量值和“要构建的项目”
我们使用 TFS Build 2010 进行构建。我们有两个源代码分支(假设branchA 和branchB)。
现在作为构建定义的一部分,我们设置要构建的项目:
现在,使用branchB中的相同构建定义意味着我创建另一个具有相同内容的构建定义文件,仅要构建的项目设置为“$/branchB”
是否有办法使其可配置,而无需编辑构建定义?
此外,我们还为构建定义设置了其他输入变量,这些变量的值包含在构建定义 XAML 文件中。因此,要更改变量的值意味着我们必须编辑构建定义 XAML 文件。这是不可取的。
我希望能够设置“要构建的项目”和构建定义的变量,而无需修改构建定义 XAML 文件。
这些问题有解决办法吗?
We are using TFS Build 2010 for Builds. We have two branches of source code (Lets say branchA and branchB).
Now as a part of the build definition we set the projects to build:
Now to employ the same build definition from branchB will mean that I create another build definition file with same content, with only the items to build set to "$/branchB"
Is there anyway to make this configurable, without having to edit the build definition?
Also there are other input variables that we set for the build definition, and the values for these variables are included in the build definition XAML file. So to change the value of a variable will mean that we have to edit the build definition XAML file. This is not desirable.
I would like to be able to set the "Items to Build" and the variables of the build definition without having to modify the build definition XAML file.
Are there any solutions to these problems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以修改构建过程模板,使其仅要求您提供要构建的项目。其余参数已预先填充。要了解其工作原理,请参阅 http://www.ewaldhofman.nl /?tag=/build+2010+定制
You can modify the Build Process Template so it only asks you for the Items to Build. The rest of the arguments are prefilled. To get an idea how this works, see http://www.ewaldhofman.nl/?tag=/build+2010+customization
您可以将参数添加到构建定义中。我不久前这样做是因为我们的解决方案中有两个 Web 项目,必须部署到不同的服务器(通过 Windows 共享)。我向构建定义添加了参数,以便在构建属性中我可以根据是否是开发部署、暂存等来自定义它们。
我添加了一篇关于如何执行此操作的博客文章。您可以通过这种方式使用参数,这样它们就不会保留在 XAML 文件中。
在 TFS 中使用自定义构建过程部署 Web 应用
You can add parameters to your build definition. I did this a while back because we had two web projects in a solution that had to be deployed to different servers (via Windows shares). I added parameters to the build def so that in the build properties I could customize them depending on if it was a dev deployment, staging, etc.
I added a blog post on how to do it. You can use the parameters this way so that they aren't kept in the XAML file.
Deploying Web Apps with a customized Build Process in TFS