How to restrict artifacts to be uploaded only from one image

Milos Chaloupka's Avatar

Milos Chaloupka

11 Oct, 2018 12:34 PM

I have a build which should run on two images. However, in the end I want to collect artifacts only from one of them. How can I achieve that? I have seen that for deployment, there is the "on" condition where it is possible to specify it. Is there anything similar for artifacts?

My yaml file:

image: 
  - Visual Studio 2017
  - Ubuntu1804
build_script:
  - cmd: build.bat
  - sh: chmod u+x ./build.sh
  - sh: ./build.sh All
test: off
version: 1.1.0.{build}
artifacts:
  - path: TickSpec\bin\Release
    name: release
  - path: 'packed_nugets*.nupkg'
    type: NuGetPackage
nuget:
  account_feed: false
  project_feed: false
  1. Support Staff 1 Posted by Owen McDonnell on 11 Oct, 2018 09:47 PM

    Owen McDonnell's Avatar

    You can make use of the for: construct like this,

    for:
      -
        matrix:
          only:
            - image: Visual Studio 2017
        artifacts:
          - path: 'packed_nugets*.nupkg'
            type: NuGetPackage
    
      -
        matrix:
          only:
            - image: Ubuntu
        artifacts:
          - path: TickSpec\bin\Release
            name: release
    

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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