Per job configuration ?

xarkes's Avatar

xarkes

11 May, 2017 04:49 PM

Hi,
I'm running multiple jobs using this:

environment:
  matrix:
    - platform: msvc
    - platform: cygwin32

Here is an example of what I want to do:

build_script:
  - matrix:
    - platform: msvc
      - cmd: msvc.bat
    - platform: cygwin32
      - cmd: git config --global core.autocrlf input
      - cmd: cygwin32.bat
Of course the above code, does not work. Is there a way to do this ? Moreover, is it appliable anywhere ? (So I can move my git command in the init part of the appveyor configuration, before cloning ?)
I know for sure that I can do this:
build_script:
  - cmd: if %platform% == msvc ( msvc.bat ) else ( cygwin32.bat )
But it is way more complicated, less readable and does not apply to what I want to do since I have many commands to run.

Thank you for your help

  1. Support Staff 1 Posted by Ilya Finkelshte... on 11 May, 2017 06:25 PM

    Ilya Finkelshteyn's Avatar

    What about using command itself in variable value, like this:

    init:
    - cmd: '%init_command%'
    environment:
      matrix:
      - platform: msvc
        init_command: echo msvc
      - platform: cygwin32
        init_command: echo cygwin32
    
  2. 2 Posted by xarkes on 11 May, 2017 06:27 PM

    xarkes's Avatar

    Ok why not, but from your answer I suppose there is no "proper" way to do what I want. This looks more like a hack than a feature :)

  3. Support Staff 3 Posted by Ilya Finkelshte... on 11 May, 2017 06:38 PM

    Ilya Finkelshteyn's Avatar

    I would say it's a tweak :) Right, this is closest to "proper" way I can think of.

  4. 4 Posted by xarkes on 11 May, 2017 06:38 PM

    xarkes's Avatar

    Ok, thank you !

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