How to handle joint projects in TeamCity

Let's say I have two “projects” in TeamCity, which are two websites, each of which uses a shared library that is not in the svn path of the website. Here is the svn structure to make it more understandable:

Website A: svn: // root / web / websitea (uses shared library a)

Website B: svn: // root / web / websiteb (uses shared library b)

Shared library A: svn: // root / shared / liba

Shared Library B: svn: // root / shared / libb

How do I set up a teamcity project for website a? Right now, I am pointing to svn: // root, but that would force it to initiate the build even if website b or shared library b was changed, which is wrong. I really need the ability to run the build only if svn: // root / web / websitea OR changes to svn: // root / shared / liba.

I tried setting up two vcs roots in the same project, which point to the two svn paths above, however, there seems to be no way to set a working directory for each vcs root. For this reason, he simply copied the contents of two SVN paths directly to the root of my build directory instead of putting them in the right places (C: \ Build \ Web \ WebsiteA and C: \ Build \ Shared \ LibA).

+8
teamcity
source share
2 answers

Checkout functionality for TeamCity is able to support the customization you are describing. My team uses it to do something similar to what you are trying to do.

First configure one root SVN file. The URL of this root will look something like this:

svn://root/ 

Then configure the following discharge rules.

For project A:

 +:web/websitea=>/web/websitea +:shared/liba=>/shared/liba 

For project B:

 +:web/websiteb=>/web/websiteb +:shared/libb=>/shared/libb 

TeamCity's documentation on checkout rules is not entirely clear on this issue, but only the specific paths that you have enabled will be used to run assemblies. This should suit your needs in order to have only changes: the website and liba run its build (and the same for B).

+13
source share

In addition to what Eric mentioned, if you need the whole source root to check, but only trigger the assembly based on specific paths, you can edit the VCS trigger rules in the Build Triggering section to have something like:

 +:web/websitea +:share/liba 
+6
source share

Source: https://habr.com/ru/post/650613/


All Articles