TeamCity的构建 - 在其他共享构建一个核心项目 [英] TeamCity build - sharing a core project across other builds

查看:138
本文介绍了TeamCity的构建 - 在其他共享构建一个核心项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个项目的解决方案,其中一个被所有其他项目所需

I have a solution with several projects, one of which is required by all other projects

我的目录看起来是这样的:

My directory looks like this:

|-MyProduct.Web
| |-MyProduct.Web.Project1
| |-MyProduct.Web.Project2
| |-MyProduct.Web.Project3
| |-MyProduct.Web.sln
|
`-MyProduct.Api
| |-MyProduct.Api.Project1
| |-MyProduct.Api.Project2
| |-MyProduct.Api.sln
|
`-MyProduct.Admin
| |-MyProduct.Admin.Project1
| |-MyProduct.Admin.sln
|
`-MyProduct.Core
| |-MyProduct.Core.Project1
| |-MyProduct.Core.Project2
| |-MyProduct.Core.Project3
| |-MyProduct.Core.Project4
| |-MyProduct.Core.Project5
| |-MyProduct.Core.sln
|
|-MyProduct.sln
|

我的TeamCity建立了MyProduct.Web,MyProduct.Api等...

I have TeamCity builds for MyProduct.Web, MyProduct.Api etc....

我遇到的问题是,所有的3对MyProduct.Core依赖
当溶液中源代码控制检查(GIT)的TeamCity构建项目,但显然它无法在MyProduct.Core依赖编译,因为它不存在。
每个构建仅仅具有MyProduct.Admin(例如)

The problem I'm having is that all 3 have a dependency on MyProduct.Core When the solution is checked in to source control (git) TeamCity builds the projects, but obviously it fails compilation on the MyProduct.Core dependency, because it is not there. Each of the builds only has the contents of MyProduct.Admin (for example)

我怎样才能得到这个与TeamCity的工作?

How can I get this to work with Teamcity?

NB - MyProduct.sln是一个全面的解决方案。
每个域都有它自己的解决方案还(因为每个项目通常包含多个的csproj)

nb - MyProduct.sln is an 'overall' solution. Each of the domains has it's own solution also (as each project usually contains multiple csproj)

推荐答案

您可以在核心项目拉动,以及在同一目录下,先建,然后建其他项目。

You could pull in the core project as well in the same directory, build it first, then build the other project.

在实践中:假设你有一个VCS根 MyProduct.Core ,另一个 MyProduct.Admin ,既重视。根到构建配置和编辑结账规则对每个:第一个将其设置为 +:=> MyProduct.Core ,第二个至 +:=> MyProduct.Admin 。之后chekout构建目录包含你在你的问题显示的确切结构,减去当然主要SLN文件。现在添加构建核心构建的步骤,另一个用于管理员。请注意,如果您需要访问git的功能得到SHA和诸如此类的东西,您必须使用结帐的代理。

In practice: suppose you have a VCS root MyProduct.Core and another one MyProduct.Admin, attach both roots to the build config and edit the checkout rules for each: for the first you set it to +.:=>MyProduct.Core , for the second to +.:=>MyProduct.Admin. After chekout the build directory contains the exact structure as you show in your question, minus the main sln file of course. Now add a build step for building core, and the other one for admin. Note if you need access to .git features to get the SHA and whatnot, you must use 'Checkout on Agent'.

这也可能用文物是可能的,但我个人preFER上面,因为那么你绝对确保一切正常得到重建,再加上它就像我做我自己的开发机器上的。

It might also be possible using artifacts, but personally I prefer the above because then you're absolutely sure everything got rebuilt properly, plus it resembles what I'm doing on my own development machine.

这篇关于TeamCity的构建 - 在其他共享构建一个核心项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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