We have many projects that are treated, built and deployed the same way and we want to have a unified TeamCity build chain for all of them.
Our build chain should contain:
- Compilation and testing for pull requests and develop branch.
- SonarQube analysis for pull requests.
- NPM publish and autolabel for merged pull requests into develop.
All of the projects are NPM packages that comply with the following:
- required scripts: install, test, clean, build
- package.json and sonar-project.properties in the root
We had the idea of using common parametrized builds for SonarQube and NPM publish, since they are agnostic to the project itself, but it looks like TeamCity does not support anything like this unless we replicate chain builds for each project.
Ideally it should look something like this:
The problem here is that if I add triggers for build finish and add dependencies to SonarQube and NPM publish for all of the projects it will require building every project and not only the one that has just been built.
TeamCity provides something like this by being able to duplicate build configurations:
I do not want to have many duplicated builds in the same way I do not fancy duplicated code. Is there a way to create the common build chain or should I move forward and look for a scripted way of generating the latter?