tag:help.appveyor.com,2012-11-13:/discussions/questions/47985-incorrect-documentation-concerning-env-varsAppVeyor: Discussion 2020-07-04T21:02:54Ztag:help.appveyor.com,2012-11-13:Comment/482925042020-04-30T09:17:11Z2020-05-04T16:35:56ZIncorrect documentation concerning env vars<div><p>Hi,</p>
<p>I've been working on migrating UI environment variables to yaml and have finally gotten it to work (yay!)<br>
However, while testing back and forth I noticed that the documentation doesn't match how environment variables are read from the appveyor.yml.</p>
<p>In documentation (<a href="https://www.appveyor.com/docs/appveyor-yml/">https://www.appveyor.com/docs/appveyor-yml/</a>):<br>
- provider: Environment name: staging on: branch: staging env_var1: value1 env_var2: value2</p>
<p>Placing env vars under "on" gave the error message "Environment deployment has been skipped as environment variable has not matched ("env_var1" is "", should be "value1")". (values changed to match dokumentation)</p>
<p>What eventually worked was:<br>
- provider: Environment name: staging env_var1: value1 env_var2: value2 on: branch: staging</p>
<p>That is, directly placed under "provider" instead of under "on".</p>
<p>Is this an error in the documentation or am I missing something?<br>
Also found this article concerning the same error message: <a href="https://help.appveyor.com/discussions/questions/5793-overriding-settings-while-deploying-from-build">https://help.appveyor.com/discussions/questions/5793-overriding-set...</a></p>
<p>/Björn</p></div>Björn Fredbergtag:help.appveyor.com,2012-11-13:Comment/482925042020-04-30T17:30:07Z2020-05-04T16:35:56ZIncorrect documentation concerning env vars<div><p>Those variables under <code>on</code> are for skipping deployment, so you can basically tell "run this deployment if only variable X has value Y." where variables under <code>provider</code> are used as settings for that deployment provider.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/482925042020-05-04T06:27:36Z2020-05-04T16:35:56ZIncorrect documentation concerning env vars<div><p>Hej,</p>
<p>Thanks for the clarification. Is this reflected in the documentation?<br>
I didn’t interpret this behavior from the documentation, but I might have missed something.</p>
<p>/Björn</p></div>Björn Fredbergtag:help.appveyor.com,2012-11-13:Comment/482925042020-05-04T16:36:44Z2020-05-04T16:36:44ZIncorrect documentation concerning env vars<div><p>There is a note here: <a href="https://www.appveyor.com/docs/deployment/#conditional-deployment">https://www.appveyor.com/docs/deployment/#conditional-deployment</a></p></div>Feodor Fitsner