How to build only when branch has changes?

mcpken's Avatar

mcpken

16 Oct, 2013 09:49 AM

currently we have 2 projects for 2 branches of a bitbucket repository.

When changes is merged to one of the branch, both project will start the building process.

Is there a way that the project with changes in its branch build only. The other project with no changes in its branch should do nothing.

  1. Support Staff 1 Posted by Feodor Fitsner on 16 Oct, 2013 05:02 PM

    Feodor Fitsner's Avatar

    Hm, I see the problem.

    Both hooks are called, but only one should trigger build. I will file a bug and fix it in the next update.

    Just curious, is it possible that the same push into remote repository could have commits for several branches?

  2. 2 Posted by Steven Thuriot on 17 Oct, 2013 08:03 AM

    Steven Thuriot's Avatar

    I don't think it is unlikely to push changes to several branches at once, depending on how often you push. I personally commit a lot, but mostly push only once a day.

    It's probably safer to check commit id's rather than pushes.

  3. 3 Posted by mcpken on 17 Oct, 2013 08:14 AM

    mcpken's Avatar

    Actually we merge pull request that goes to one branch.

    From what I checked, other branch is not updated.

  4. Support Staff 4 Posted by Feodor Fitsner on 17 Oct, 2013 02:10 PM

    Feodor Fitsner's Avatar

    OK, what if we make a list of all branches affected by the push (check all commits in GitHub/BitBucket webhook payload) and trigger new builds for corresponding projects?

  5. 5 Posted by mcpken on 18 Oct, 2013 12:02 AM

    mcpken's Avatar

    Yes I think that works. since each project is setup for 1 branch in the
    setting.

  6. Support Staff 6 Posted by Feodor Fitsner on 24 Oct, 2013 07:22 PM

    Feodor Fitsner's Avatar

    Hi guys,

    The functionality has been just deployed with the latest AppVeyor update. Now webhook triggers build if only both project's repository and branch match.

  7. Feodor Fitsner closed this discussion on 24 Oct, 2013 07:22 PM.

  8. mcpken re-opened this discussion on 25 Oct, 2013 10:17 AM

  9. 7 Posted by mcpken on 25 Oct, 2013 10:17 AM

    mcpken's Avatar

    That's great!
    Will check it out.

  10. 8 Posted by hannajohn on 14 Sep, 2015 05:18 PM

    hannajohn's Avatar

    is this feature still available? if yes, can you please provide an example? I couldn't find documentation

  11. Support Staff 9 Posted by Feodor Fitsner on 14 Sep, 2015 05:20 PM

    Feodor Fitsner's Avatar
  12. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:00 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac