Does BinTray provider respect any environment variables?
I'd like to alter which BinTray package I deploy to based on the branch being compiled. Can I add a pre-deployment script to set a specific environment variable or should I just go with a full custom PS script and bypass the existing provider?
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 22 Aug, 2016 09:09 PM
Yes, custom environment variables should be respected there.
2 Posted by lenox.joseph on 23 Aug, 2016 12:16 AM
Is there a list of what gets used by the provider, or is it the straight
configuration options?
Support Staff 3 Posted by Feodor Fitsner on 23 Aug, 2016 12:35 AM
This is the list of system environment variables: https://www.appveyor.com/docs/environment-variables/
You can use any environment variable though like this: https://www.appveyor.com/docs/deployment/#environment-variables-in-provider-settings
-Feodor Fitsner, AppVeyor
4 Posted by lenox.joseph on 23 Aug, 2016 02:28 AM
If I define a new environment variable in the pre-deployment script, will
it be used during deployment?
--Joseph Lenox
Support Staff 5 Posted by Feodor Fitsner on 23 Aug, 2016 02:29 AM
It should though I can say for sure if see your appveyor.yml
-Feodor Fitsner, AppVeyor
6 Posted by lenox.joseph on 23 Aug, 2016 03:21 PM
Apparently not, I had set $packagevar in the configuration and created the
environment variable using the following script:
[Environment]::SetEnvironmentVariable("packagevar", "Slic3r_Branches",
"User")
If ($APPVEYOR_REPO_BRANCH -like "master")
{[Environment]::SetEnvironmentVariable("packagevar", "slic3r_dev", "User")}
Uploading "slic3r-3440-draft-shield--566bbbd.zip" to BinTray as
lordofhyphens/Slic3r/$packagevar/1.3.0-3440-draft-shield-165/slic3r-3440-draft-shield--566bbbd.zip
--Joseph Lenox
Support Staff 7 Posted by Feodor Fitsner on 23 Aug, 2016 04:07 PM
Correct code might be:
8 Posted by fredrik.averpil on 23 Aug, 2016 08:07 PM
Having this very same issue. Posted about it here: http://help.appveyor.com/discussions/questions/2585-how-to-use-vari...
9 Posted by fredrik.averpil on 23 Aug, 2016 08:39 PM
I solved it:
10 Posted by Ilya Finkelshte... on 24 Aug, 2016 12:26 AM
Right, this is expected, because build execution is not single PowerShell script, and variables are not preserved between separate PowerShell statements, while environment variables do exist till the end of build job.
--ilya,
11 Posted by fredrik.averpil on 24 Aug, 2016 06:05 AM
It took some time to figure this out, as I wasn't able to call that environment variable like
$env:SOMETHING_UNIQUEor$SOMETHING_UNIQUE. Instead I had to call it like$(SOMETHING_UNIQUE).12 Posted by lenox.joseph on 24 Aug, 2016 07:51 AM
Thanks, that works. Maybe this should be added to the main support
documents?
13 Posted by fredrik.averpil on 24 Aug, 2016 08:11 AM
+1
Support Staff 14 Posted by Feodor Fitsner on 24 Aug, 2016 08:38 PM
There is a note about that: https://www.appveyor.com/docs/deployment/#environment-variables-in-...
You may contribute to the documentation if you feel something's missing.
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:08 AM.