Atlassian Bamboo: don't trigger build if changes were made to a specific file

StackOverflow https://stackoverflow.com/questions/22931325

  •  29-06-2023
  •  | 
  •  

سؤال

I have a plan in Bamboo that starts whenever changes are made to the attached repositories (via polling).

Now, on each build, if successful, a CHANGELOG file is updated in the repo, which in turn, triggers another build. How can I omit certain files from Bamboo's polling, so that a build isn't started if changes are found for those files? Because otherwise, I enter in infinite loop, with a change to CHANGELOG triggering another build which in turn updated CHANGELOG and so on.

If this is not possible, what other viable solutions are there? Is it possible to attach a shell script somewhere before the build starts to check whether it's desired to start a new build?

هل كانت مفيدة؟

المحلول

It turned out that this was simpler than I've thought. In Plan Configuration, in the Repositories tab, on each repository, under Advanced, there is an Include / exclude files input where you can Customise what files Bamboo uses to detect changes. By adding a regular expression there, I got everything solved and working as expected.

Bamboo pattern matching reference: https://confluence.atlassian.com/display/BAMBOO/Pattern+matching+reference

نصائح أخرى

The Bamboo Documentation says:

Bamboo will ignore build triggers if the local working copy and the repository copy have the same revision numbers.

This might not be the best solution, but you might add an additional task at the end of the job/build which updates the repository again to avoid triggering a new build.

I'm not sure if this would then skip builds from repository updates which occur during the current build.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top