Multiple web project in a single repo - deploy only some of them

I have a git repo which contains a single .Net solution with several web applications (public site, internal site, public services) and a shared class library project. I want to deploy some of the projects based on the changes that were made. For example if I fixed a bug in public site I want to only deploy that site, if I fixed bug in public site and api I want to deploy both of them and so on. I can achieve it by creating different build configurations and using trigger rule and filter by Ant_like_wildcard folder path and deploy corresponding project.

The tricky case in when I make a change only in a shared class library but in any of the web apps. In that case I have the following options:

  • Make a dummy change in the web apps which must be deployed
  • Include web projects which must be deployed in commit message and use VCS_comment_regexp for filtering triggers
  • Parse git commit message, set parameters using setParameter in build script and use those parameters in following steps.


I don't like any of the options because they seem hacky. Is there any better option for this case?

6 comments
Comment actions Permalink

Hi Giorgi,

You can create different build configurations: A - public site, B - internal site, ..., C - all apps + shared class library, which will check out needed files, trigger builds depending on trigger rules and publish required artifacts. For each build configuration create it's own dependent deployment build configuration A1 ... C1 with finish build trigger (or VCS build trigger). You can use templates to simplify the setup.

0
Comment actions Permalink

The problem is that when I make a change to the class library project there is no automated way for teamcity to know which web apps the changes applies too and which ones should be deployed. I am looking for the least error prone and least manual way to automate it.

0
Comment actions Permalink

How do you understand which web apps should be deployed after commit to the shared class library?

0
Comment actions Permalink

There is no automated way, when developer makes a change he know which web apps should be deployed.

0
Comment actions Permalink

In this case I think the easiest way is to trigger needed builds using REST API.

0
Comment actions Permalink

GiorgiD schrieb:

The problem is that when I make a change to the class library project there is no automated way for teamcity to know which web apps the changes applies too and which ones should be deployed. I am looking for the least error prone and least manual way to automate it.


I would recommend splitting the build file.
In the first step, it is of course more work, but thereafter, with dependencies etc. your project/deployment can probably be completely automated.

0

Please sign in to leave a comment.