How to override environment variables from REST API when using build matrix
When using build matrix, I cannot find out how to override the environment variables from REST API.
My small example is in this repository
https://github.com/nkns165/appveyor-test
Assume I'm kicking the build with a command like this. I'm trying to overwrite the variable "VAR1".
curl -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" https://ci.appveyor.com/api/account/nkns165/builds -X POST -d "{
\"accountName\": \"nkns165\",
\"projectSlug\": \"appveyor-test\",
\"branch\": \"master\",
\"environmentVariables\": {
\"VAR1\": \"Value2\"
}
}"
Success without build matrix
https://ci.appveyor.com/project/nkns165/appveyor-test/builds/33401661
- There are two images used, but there is no matrix
- The script output the overridden value "Value2"
Failure with build matrix
https://ci.appveyor.com/project/nkns165/appveyor-test/builds/33401705
- Each image's build script is defined in matrix
- The script output the default value "Value1" instead of expected value "Value2"
Is there any way to override the values by REST API parameters?
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
Support Staff 1 Posted by Feodor Fitsner on 09 Jun, 2020 04:30 AM
Removing
VAR1
definition from the config should do the trick:2 Posted by TAMAGAWA Hiroko on 09 Jun, 2020 05:22 AM
Confirmed, thanks.
Umm, then we have to add some merging logic if we'd like to also have default values.
OK, I think we can do it
TAMAGAWA Hiroko closed this discussion on 09 Jun, 2020 05:23 AM.