Meaning of "global:" in "environment:" of appveyor.yml

vitaly.krugl.numenta's Avatar

vitaly.krugl.numenta

18 Mar, 2016 12:28 AM

https://www.appveyor.com/docs/appveyor-yml has a commented-out example that uses the section "global:" inside "environment:", but it doesn't explain the significance of having environment variables declared inside this "global:" section versus simply declaring environment variables directly inside "environment:".

For example:

environment:
  my_var1: value1

  global:
    my_var2: value2

What's the difference between my_var1 that's declared under environment and my_var2 that's declared inside global?

Many thanks,
Vitaly

  1. Support Staff 1 Posted by Feodor Fitsner on 18 Mar, 2016 02:52 AM

    Feodor Fitsner's Avatar

    "global:" is used together with "matrix:" and allows defining variables for all matrix permutations.

    -Feodor

  2. 2 Posted by wtf? on 07 Nov, 2017 12:44 PM

    wtf?'s Avatar

    So variables inside `environment:` aren't visible inside matrix jobs?

  3. Support Staff 3 Posted by Ilya Finkelshte... on 07 Nov, 2017 10:45 PM

    Ilya Finkelshteyn's Avatar

    Actually you are correct, environment variables from environment and environment/global works the same way with matrix now. But we support this environment/global for historical reasons and also it is considered clearer expression when matrix exist in the configuration.

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