How to fail build with first job

oliver's Avatar

oliver

10 May, 2018 09:03 PM

Hey.

What is the correct config for failing the build with the first job that fails in a config with a matrix for 3 different images?

  1. Support Staff 1 Posted by Owen McDonnell on 10 May, 2018 09:35 PM

    Owen McDonnell's Avatar

    If you are using yaml config file,

    matrix:
      fast_finish: true
    
    as documented here
  2. 2 Posted by oliver on 10 May, 2018 09:41 PM

    oliver's Avatar

    does seem to work:

    environment:
      access_token:
        secure: ....
      fast_finish: true
      matrix:
        - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
        - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
          PowershellVersion: "6.0.0"
        - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
          PowershellVersion: "6.0.0"
    

    and the result:
    https://ci.appveyor.com/project/AtlassianPS/jiraps/build/2.6.99020-...

    The 3rd job ran, even after the 2nd failed

  3. Support Staff 3 Posted by Owen McDonnell on 10 May, 2018 10:10 PM

    Owen McDonnell's Avatar

    Looks like you are naming an environment variable fast_finish. Instead fast_finish should be a key under top-level matrix key.
    The matrix key under environment key defines the groups of environment variables you want to use as a build matrix dimension.

    An example from same page of the docs.

    environment:
      # these variables are common to all jobs
      common_var1: value1
      common_var2: value2
    
      matrix:
        # first group
        - db: mysql
          provider: mysql
    
        # second group
        - db: mssql
          provider: mssql
          password:
            secure: DHEU39J6X9VD376==
    
    platform:
      - x86
      - Any CPU
    
    configuration:
      - Debug
      - Release
    
    matrix:
      fast_finish: true
    

    Also, if you are wanting to build on 3 different images you should have a top level image key that lists them like so,

    image:
    - Visual Studio 2017
    - Ubuntu
    
  4. 4 Posted by oliver on 11 May, 2018 07:24 AM

    oliver's Avatar

    I don't get it.... wouldn't

    image:
    - Visual Studio 2017
    - Ubuntu
    
    conflict with my
    environment:
        matrix:
            - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
            - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
              PowershellVersion: "6.0.0"
            - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
              PowershellVersion: "6.0.0"
    
    ?
  5. Support Staff 5 Posted by Owen McDonnell on 11 May, 2018 04:49 PM

    Owen McDonnell's Avatar

    Sorry, you're right. You can keep the tweak environment variables as is and skip the image: key, though you could migrate away from that using for: node in build matrix configuration to specify different variables for each image. Here is a blog post about it if you're interested.

    So is fast_finish now working as you expected?

  6. 6 Posted by oliver on 11 May, 2018 05:38 PM

    oliver's Avatar

    yes. perfectly. thank you

  7. oliver closed this discussion on 11 May, 2018 05:38 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