'Shared' settings for appveyor.yml with conditional branches.

sebastian's Avatar

sebastian

04 Jul, 2015 07:53 AM

AppVeyor can handily take care of different build and deployment configurations for different branches by using a Conditional build configuration as described here 'http://www.appveyor.com/docs/branches#conditional-build-configurati...;.

What would be cool would be if we could declare configuration settings that are common outside the branch conditions, like so:

#do something in every build regardless of branch
init:
   - do some init stuff

# do the following only for master branch
-
  branches:
    only:
      - master

  configuration: Release
  deploy:
    provider: AzureCS
 
# do the following only for 'dev' branches
-
  branches:
    only:
      - /dev-.*/

  deploy:
    provider: Local

Not sure how much effort this is to implement, but it would sure make our appveyor files neater, easier to declare conventions.

  1. Support Staff 1 Posted by Feodor Fitsner on 05 Jul, 2015 08:57 PM

    Feodor Fitsner's Avatar

    Sounds like a nice idea. The only note here is that you can't mix hashes and lists on the same level. It should be something like:

    # common for all branches
    init:
    - do_something.cmd
    
    # branch-specific
    for:
      - branches:
          only:
            - master
        configuration: Release
        deploy:
          provider: AzureCS
      # do the following only for 'dev' branches
      - branches:
          only:
            - /dev-.*/
        deploy:
          provider: Local
    

    Don't know if for looks intuitive - feel free to suggest variants. The idea of inclusions was captured here, but I'll created a new issue: https://github.com/appveyor/ci/issues/325

  2. 2 Posted by sebastian on 06 Jul, 2015 08:13 AM

    sebastian's Avatar

    Uuh `for` seems okay o me... If you want something more specific to the
    actual function of the block maybe `case` or `override` might work too.

  3. Support Staff 3 Posted by Feodor Fitsner on 07 Jul, 2015 06:32 PM

    Feodor Fitsner's Avatar

    case sounds good too.

  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:57 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