This is an attempt to implement a conditional build across branches, impossible by default because of BAM-11257, open since 2012, still pending.
Context:
develop
branchImplemented (not working) approach:
(?=(feature.*|bugfix.*)).*$
). Then it provides the desired behavior in its stages and jobs(?=(hotfix.*|release.*)).*$
), then with its own behavior in stagesdevelop
.This works fine, each branch has its own build plan based on the desired behavior. However, when merging any branch into develop
, the three build plan start in parallel, because the three of them have develop
in their "Repositories" as original branch entry.
Question: how could this side effect be avoided? How could we specify a build plan for certain branch types only and not also for the original branch (in this case develop
)?
I understand Bamboo needs an origin from which cloning new build plan for its branches according to a certain strategy (the regex), but how can we block it to run the build plan for the original branch as well? Or, can we define a build plan for a branch type independently than its origin and based on a dynamic name (e.g. feature-something
, feature-bob
)?
(On this last point: in "Repository" we can specify a branch as origin, but that's a static value, we cannot put a regex there, which would fix the overall issue, I suppose)
I've been facing similar issues. The only workaround I found was to stop using "linked repositories". Don't know if you're familiar with this but you can either use a "linked repository" which is available to all Build Plans or you can create one specifically for your Plan. To solve my issue, I had to add a repository of type "Git" (even though we use GitHub). This allowed me to leave the "branch" field empty, thereby fixing my issue.
EDIT In fact I had to specify a "wrong" branch name in this field to get it working...
Hope this helps. Simon