Availability of Custom Environment in apvoyer config
Hi,
Where can the custom Environment variables be defined? and their scope?
For eg., if I define a custom Environemnt variable in install script, will it be available in build_script and artifacts block of the appveyor.yml?
For clear understanding, I am referring to the 'POM_VERSION' defined under the install script in the following config:
https://github.com/PathriK/GaanaDownloader/blob/master/appveyor.yml
Thanks,
Keerthi Kumar P
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
1 Posted by Ilya Finkelshte... on 05 Jan, 2017 05:10 PM
Hi Keerthi,
It seems that you just fixed it, while I looked into your script, by pre-pending it with
$env:
Also it will not hurt if you set default value in YAML, as described here
Thanks!
Ilya.
2 Posted by pathrikumark on 06 Jan, 2017 12:35 AM
Nope. Even after appending $env it is not working :(. In the following build:
https://ci.appveyor.com/project/PathriK/gaanadownloader/build/1.1-SNAPSHOT.12
we can see that the custom env variable (POM_VERSION), that is set in the install script gist is not available outside in build script(did Writ-Host to check) and also the artifact block.
Also this env variable needs to dynamic and hence setting it in script rather then in YAML.
Thanks
3 Posted by Ilya Finkelshte... on 06 Jan, 2017 04:14 AM
Can you enter content of https://gist.github.com/PathriK/ac922260d2714cd0bf9ba9cc946092f3/ right into YAML, at
install
stage?I my example I was calling script this way because it was long script, to keep YAML readable, but you can easy add the following into
install
(still keeping it compact and actually better understandable):Thanks!
Ilya.
4 Posted by pathrikumark on 06 Jan, 2017 05:11 PM
Yup its working, when i place the lines as you suggested. Thanks a lot :D
So does it mean that the Custom Environment variables set through 'iex', does not persist out side that script block?
Thanks,
Keerthi Kumar P
5 Posted by Ilya Finkelshte... on 09 Jan, 2017 07:29 PM
Setting variables with
iex
should work as well. I think it did not work fro you because link toraw
gist is different for every revision, so script which was actually executed was not updated. To make it work withiex
you have to update the gust, but again for such a small script it is better to keep it's content in YAML.--ilya.
6 Posted by pathrikumark on 10 Jan, 2017 12:28 AM
Oh... okie.. now I get it. Thanks a lot ilya :)
pathrikumark closed this discussion on 10 Jan, 2017 12:28 AM.
Ilya Finkelshteyn re-opened this discussion on 18 Feb, 2017 04:01 AM
7 Posted by Ilya Finkelshte... on 18 Feb, 2017 04:01 AM
BTW, recently found how to make permalink to GitHub gist
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:15 AM.