1

We've been using Bamboo YAML specs to run our build plans. We use the default repository + a linked repository in that plan. The build plan now triggers if a commit/new branch has been created in the default repository (=desired behavior), but also when the linked repository has an update (=undesired behavior). How can I disable this via YAML specs?

The Bamboo documentation does not help me, and looking at a 'normal' (non-YAML specs) build plan does not work either, since this option is not converted to YAML specs when selecting 'view as YAML specs'. It does not show in the YAML specs if the trigger of the linked repo is on or off (see attached picture).

Help would be much appreciated! Example

DutchJ
  • 85
  • 1
  • 8

3 Answers3

1

This will disable trigger

---
version: 2
triggers: []

https://docs.atlassian.com/bamboo-specs-docs/8.2.0/specs.html?yaml#plan-branches

This will enable trigger for specific repository

---
version: 2
...
triggers:
- bitbucket-server-trigger:
    repositories:
    - your_repository_name_here

https://docs.atlassian.com/bamboo-specs-docs/8.2.0/specs.html?yaml#triggering-selected-repositories

0

Insert a script task that compares bamboo.planRepository.<position>.revision to bamboo.planRepository.<position>.previousRevision (find the correct <position> for your repository). Skip the plan build (exit 0) if the two are the same.

Move away from YAML specs. They are still very limited compared to Java specs.

Alex
  • 1,313
  • 14
  • 28
0

I was having same problem. But for this problem there is no perfect solution i.e, either you can disable triggers from all repositories or you keep all triggers

solution is in bamboo.yml

  1. triggers: [] (make sure this tag goes in plan section otherwise it will not work) [example spec from working project][1] [1]: https://i.stack.imgur.com/pfeTu.png

there is one more way on Bamboo linked repository level

  1. Linked repo -> General -> Change detection options -> Include/exclude files -> select exclude change set -> enter exclude value as .* -> save

Change detection option is basically when you want to filter which commits to include or exclude and we are excluding all the changes. This option only works on primary repository.