Label build sources for all dependencies
When creating release builds I like to tag them and pin them. One of the options for tagging a build is to apply it to all the dependencies.
Likewise I apply a label to the sources using "Actions > Label this build sources...". Is there a way to apply labels to all of the dependencies?
Please sign in to leave a comment.
No, at the moment TeamCity does not have such action. One possible workaround is to attach all VCS roots of the chain to some final build configuration.
How do you attach all VCS roots of the chain to some final build configuration? I'd like to give it a try but couldn't figure out how to do that
We have a feature request to implement it directly on dependencies, feel free to vote for it: https://youtrack.jetbrains.com/issue/TW-44941/Make-source-labelling-work-for-dependencies-VCS-roots
Would be able to expand a bit more on the benefits/drawbacks of using a regular build configuration vs. composite build config for this task?
To give an update, I've been able to add a regular build configuration and I've also figured out how to attach all the dependencies roots. But I hadn't realized that I could optimize the build to not have to check out files.
Two things were not obvious to me:
1. that VCS roots can be setup hierarchically; and
2. that in order to be able to attach the roots of dependencies, the roots have to be defined at a project level that matches the level of the configuration that does the labeling (or higher)
I am still wrapping my head around projects vs. build configurations and when I should set up one vs the other.
For now, I have moved all the VCS roots from sub-projects to a higher level in the project hierarchy (some all the way to the root project and others just high enough) so that they could be visible and attached to the "tagging build config" that I created (I'm calling it tagging because it's supposed to create Git tags, which are called Labels in TeamCity).
In TeamCity, the idea of a project is basically a hierarchy and configuration component. It allows you to structure your builds and set both shared configurations as well as restrict permissions. Build configurations are the components that actually define how builds should behave. When you have settings that want to be shared across multiple configurations, you want to set them at the project level, and at the project level where all the configurations that need that setting hang from (or you will need to have it duplicated with the issues of desync that that might cause).
In general, we structure components at the project or build configuration level based on our experience, our own requirements or from users. From those sources we understand that the need for some component is shared between multiple configurations (such as VCS Roots, or a connection to a docker repo) and then we add that to the project level, while others are specific to a build (such as labeling or reporting the status of the build), and the build configuration is just what defines what the build does.