tag:help.appveyor.com,2012-11-13:/discussions/problems/383-environment-variables-doesnt-expand-buildAppVeyor: Discussion 2018-08-25T01:50:24Ztag:help.appveyor.com,2012-11-13:Comment/332770252014-06-04T21:31:37Z2014-06-04T21:32:15ZEnvironment variables doesn't expand "{build}"<div><p>I don't know what to call the group of variables that is
"{build}" and "{version}", etc. but they are not being
expanded.</p>
<p>I have</p>
<pre>
<code>environment:
BUILD_NUMBER: "{build}"</code>
</pre>
<p>in my <code>appveyor.yml</code>, and the first thing I do during
build is echo it, and it return <code>{build}</code> instead of the
build-number.<br>
This breaks my build as the result is not a valid version
string.</p></div>Alxandrtag:help.appveyor.com,2012-11-13:Comment/332770252014-06-04T21:38:10Z2014-06-04T21:38:10ZEnvironment variables doesn't expand "{build}"<div><p>There are built-in variables for both build version and number:
<a href=
"http://www.appveyor.com/docs/environment-variables">http://www.appveyor.com/docs/environment-variables</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/332770252014-06-04T21:50:16Z2014-06-04T21:51:59ZEnvironment variables doesn't expand "{build}"<div><p>That's fair and square, but some build-tools require spesific
environment variables. So I need to be able to set the
environment-variable "BUILD_NUMBER" to my build number. The
alternative solution to this is obviously to do <code>set
BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER%</code>, but this should really
be doable in the environment-settings if you ask me.</p></div>Alxandrtag:help.appveyor.com,2012-11-13:Comment/332770252014-06-04T23:58:42Z2014-06-04T23:58:42ZEnvironment variables doesn't expand "{build}"<div><p>Right, <code>environment</code> section does not expand
variables in values. I will add an issue to fix that.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/332770252014-07-25T13:04:05Z2014-07-25T13:04:05ZEnvironment variables doesn't expand "{build}"<div><p>Was this ever fixed?</p></div>Alxandrtag:help.appveyor.com,2012-11-13:Comment/332770252014-07-25T13:10:58Z2014-07-25T13:10:58ZEnvironment variables doesn't expand "{build}"<div><p>Not yet. Is there any other place where you need that
functionality, except BUILD_NUMBER?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/332770252014-07-30T19:57:37Z2014-07-30T19:57:37ZEnvironment variables doesn't expand "{build}"<div><p>I think the environment variable name has changed with later
versions of "k" and "sake" (they are too volatile to keep up with
at times), but I don't need the functionality anywhere but env
vars. Anywhere else should be able to use the env vars.</p></div>Alxandrtag:help.appveyor.com,2012-11-13:Comment/332770252014-10-24T00:00:02Z2014-10-24T00:00:02ZEnvironment variables doesn't expand "{build}"<div><p>Any news on this?</p></div>Alxandrtag:help.appveyor.com,2012-11-13:Comment/332770252014-10-24T00:03:49Z2014-10-24T00:03:49ZEnvironment variables doesn't expand "{build}"<div><p>Oh, is it still actual? :)</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/332770252014-10-24T04:29:07Z2014-10-24T04:29:07ZEnvironment variables doesn't expand "{build}"<div><p>I still have "stupid stuff" like this in my appveyor.yml
file:</p>
<pre>
<code> - set K_BUILD_VERSION=000%APPVEYOR_BUILD_NUMBER% #temp
- set K_BUILD_VERSION=%K_BUILD_VERSION:~-4%</code>
</pre>
<p>What would really be helpful was if I could do environment
variable <code>K_BUILD_VERSION: {build:0000}</code> ala C#
<code>string.Format</code>, though at least being able to use the
build number itself. Also, the need to pad the numbers disappear
once NuGet gets support for semver 2.0 which means I'd just need to
set the environment variable <code>K_BUILD_VERSION</code> to equal
the build number. Why this works other places and not in the
environment variables I find strange.</p></div>Alxandrtag:help.appveyor.com,2012-11-13:Comment/332770252014-11-23T22:30:40Z2014-11-23T22:30:41ZEnvironment variables doesn't expand "{build}"<div><p>I'd like to do:</p>
<pre>
<code>environment:
- GOPATH: %BuildFolder%</code>
</pre>
<p>As suggested by <a href=
"https://bitbucket.org/appveyor/test-go/src/003c20c6d3409281436160a20f4b9d0b64e63b36/build.cmd">
this script</a> except well, I want to have a declarative statement
for that in my <code>appveyor.yml</code>.</p>
<p>This is pretty much the same issue.</p></div>Lorenz Leutgebtag:help.appveyor.com,2012-11-13:Comment/332770252014-11-23T22:44:14Z2014-11-23T22:44:14ZEnvironment variables doesn't expand "{build}"<div><p>Correction: It works, I was just using
<code>%BuildFolder%</code>instead of
<code>%APPVEYOR_BUILD_FOLDER%</code>. Maybe consider updateing your
Go example on Bitbucket.</p></div>Lorenz Leutgebtag:help.appveyor.com,2012-11-13:Comment/332770252014-11-23T23:56:18Z2014-11-23T23:56:18ZEnvironment variables doesn't expand "{build}"<div><p>OK, sure.</p></div>Feodor Fitsner