I have a MonoRepo and am trying to set up bamboo-specs, that will build only the service that is changed.
I have been able to do this with plan repository with change-detection; However, what i would like to do is have one Linked Repository, that all my plans use, and still have the file filter applied so only run the build plan for the folder that changes. I really dont want to set up 100's of "duplicate" linked repos with the change detection on them.
If it cant be done with the repo level, is there a change detection task that can be applied that will only run the rest of the tasks if condition is met
Repo
- Service1
- Service2
...
repositories:
- repo1:
type: bitbucket-server
server: Bitbucket
project: XXXX
slug: xxxx
clone-url:
public-key:
private-key:
branch: master
command-timeout-minutes: '30'
use-shallow-clones: true
cache-on-agents: true
submodules: false
ssh-key-applies-to-submodules: false
verbose-logs: false
fetch-all: false
lfs: false
change-detection:
file-filter-type: include_only
file-filter-pattern: Service1/.*
Hello @Dave Attard
Having a monolithic architecture with dynamic triggers based on the content that has been modified is something that is not available in Bamboo.
As an alternative, you can set a single Plan that would be triggered on every commit of that mono repo and then Checkout the repository and initiate a Script Task that will analyse the last revision's contents and trigger the required builds in Bamboo over REST API.
For example, the following git command will return the list of the files modified in the HEAD revision:
$ git diff-tree --no-commit-id --name-only -r HEAD
Then, from that output you can make the script realise which Plans are to be triggered, then use the Bamboo REST API to initiate their builds:
That is a quite simple theory that would work for your case. You may have to extend the script to consider (and trigger) other branches in case you use Plan branches in Bamboo.
Sincerely,
Eduardo Alvarenga
Atlassian Support APAC
--please don't forget to Accept the answer if the reply is helpful--
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.