Different builds from one branch.

Greetings, Ladies and Gentlemen!

Our setup is TeamCity, some VCS, Nexus, Maven. Please explain if its possible to implement what we want in TeamCity.

I have only one branch in my VCS system, but I need to support SEVERAL different builds based on it. Lets call it two builds of our product for Home and Office. Three situations are possible (we still dont know which way to choose for our project) :

1) One branch, one Maven artifact, this results into two TeamCity builds: builds depend on Maven profiles (-pHomeBundle and -pOfficeBundle). Is it possible for TeamCity? If its possible what will happen if some code in the branch is updated - both Home and Office builds will be rebuilt?

2) One branch, 3 Maven artifacts, 2 depend on one: Home and Office depend on Common and again all this results into 2 TeamCity builds: Home and Office. I dont want Home to fail if Office failed. Is it possible? Also in this case I dont want to build Home artifact if only Office artifact was changed. I want to rebuilt both if Common was changed.

3) One branch, 3 Maven artifacts, but this time instead of Home and Office I use the same artifact declared TWICE with different versions. In the same Maven POM. I am not sure its possible at all. If its possible - can TeamCity build two different versions of the same artifact from the same branch?

1 comment
Comment actions Permalink

Hello Dmitry,

First of all, you can have as many build configurations using same VCS as you like.

TeamCity can build any artifacts combination that can be produced by Maven, so it is the question of Maven limitations.
Triggering is very flexible, too: you can use combination of VCS triggers and Maven Artifacts triggers.

As to the scenarios, the choice is up to you:

1. TeamCity can handle active profiles. You can provide them as "Additional Maven command line parameters", or use build configuration specific maven settings (see this documentation page for details)
2. In this case, you may want to setup 3 Teamcity build configurations: Common, Home and Office. And have "Maven artifact dependencies" triggers in Home and Office configurations.
3. I am not sure I understand what you mean, but as long as you can do it using command line in development environment, TeamCity can do it too.

If the project is supposed to be a long-term, I'd use second way.

0

Please sign in to leave a comment.