build on specific branches or specific file changes

Arian's Avatar

Arian

24 Oct, 2018 08:58 AM

Hi,
I am trying to have a build that builds on specific branches or on specific file changes. when I use this configuration it does not work, is it possible to configure a build like this or do I need to have duplicate yml files to filter on different things?

branches:
  only:
    - develop
    - master
    - /support.*/
only_commits:
  files:
    - src/Server.Setup/**/*

  1. Support Staff 1 Posted by Owen McDonnell on 24 Oct, 2018 03:30 PM

    Owen McDonnell's Avatar

    No need for duplicate yml files. What you have should work to limit which branches and what file changes are allowed to trigger a build.
    If you think there is a problem, please link to the build and provide your config file.

  2. 2 Posted by Arian on 25 Oct, 2018 07:06 AM

    Arian's Avatar

    I want to have an OR condition between them so it always build the specified branches, OR other branches that have the specified file changes.

  3. Support Staff 3 Posted by Owen McDonnell on 25 Oct, 2018 07:50 PM

    Owen McDonnell's Avatar

    I see. You could try to make use of for node as outlined in this blog post.
    Something like this,

    
    #your config
    
    for:
      -
        branches: 
          except: 
            - develop 
            - master 
            - /support.*/ 
     
        only_commits: 
          files: 
            - src/Server.Setup/**/*
    
  4. 4 Posted by Arian on 26 Oct, 2018 10:33 AM

    Arian's Avatar

    cool! it worked, Thanks.

  5. Owen McDonnell closed this discussion on 26 Oct, 2018 03:46 PM.

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