I've got an interesting problem for you all. We have a a number of projects in a build chain, each producing their own artifacts. There are a lot of dependencies so to minimize disk space usage we don't output full "install" builds during CI. When we want to deploy a build, we'd like to be able to grab the latest build for a specific branch in a "package" build configuration that 1) collects all the artifacts and dependencies, 2) creates an RPM, 3) versions the package, and 4) dispatches it to a deployment management system. So far I've been able to get this working functionally, but the ergonomics are a bit off. Each package build requires the user to manually select the branch they want to build and the changes field includes all branches, which adds a lot of noise making it difficult to see what hasn't been packaged for deployment yet.
As an example consider the following build chain:
Project A <---- Project B <---- Project C <----- Package Build
With the following build project structure:
Continuous Integration -- builds all feature, release, and master branches using VCS triggers, runs unit and integration tests
Project A, Project B, Project C
Release -- Only creates a package for a specific release branch, assembling the relevant artifacts from the branch builds, fetching dependencies, etc
Package Build -- Builds release/sprint20, applying version 2.5.* as defined in the "Build number format" property, uses artifacts from the existing CI build for that branch
Package Build -- Builds release/sprint21, applying version 2.6.* as defined in the "Build number format" property, uses artifacts from the existing CI build for that branch
This turns out to be tricky to accomplish because restricting the configuration to just a single branch looks impossible. The "package" configuration doesn't need a VCS root and should really just inherit branch information from the last build configuration in the build chain. However there is no good way to define the default branch, since if I run the build using the default branch it attempts to use the corresponding default branch for the CI builds (master) which is incorrect.
TL;DR: Can the default branch of a build configuration be defined without using a VCS root, and explicitly propagated to the dependend builds in the build chain (as opposed to being derferenced by each configuration in the chain)?