I am not sure if what I want to do is possible so I guess I am asking can I do this and if I can how?
I have a Team City server with 4 build agents across multiple machines. I am using git with feature and develop branches and a split of unit and integration tests all run using gradle. So my unit test task in gradle is called unitTest (quel suprise :-) ) and my integration test is called, you guessed it, integrationTest.
Everytime a feature branch is checked in I want to run the unitTest task for all projects (this is a multi-project gradle build), however if a particular project has changed then I want to run the integrationTest task.
As mentioned this is a multi-project gradle build with a single build for a feature branch. When a change is integrated into develop I have split each project into single builds so I have that scenario covered.
I was wondering it there is any way to identify which projects within the repository has changed and then dynamically setting the task in Team City, the task is already driven by a parameter so if someone uses the elipses to run a build they can alter the task run. Lets say that parameter is called task and we have the following project structure:
a commit to any project would leave the task parameter at the default unitTest setting, however if projectB changed I could override the task parameter to be unitTest :projectB:IntegrationTest
I just don't know if it is possible to identify that projectB is the one that has changes. I do not want to break this out to run each project independently because I want gradle to handle the dependencies for me, that is what it is good at and I also want the artifacts from projectA to be used by the projectB build and we have many feature branches.
Thanks for any help.