Environment variables doesn't expand "{build}"
I don't know what to call the group of variables that is "{build}" and "{version}", etc. but they are not being expanded.
I have
environment:
BUILD_NUMBER: "{build}"
in my appveyor.yml
, and the first thing I do during
build is echo it, and it return {build}
instead of the
build-number.
This breaks my build as the result is not a valid version
string.
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 04 Jun, 2014 09:38 PM
There are built-in variables for both build version and number: http://www.appveyor.com/docs/environment-variables
2 Posted by Alxandr on 04 Jun, 2014 09:50 PM
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
set BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER%
, but this should really be doable in the environment-settings if you ask me.Support Staff 3 Posted by Feodor Fitsner on 04 Jun, 2014 11:58 PM
Right,
environment
section does not expand variables in values. I will add an issue to fix that.4 Posted by Alxandr on 25 Jul, 2014 01:04 PM
Was this ever fixed?
Support Staff 5 Posted by Feodor Fitsner on 25 Jul, 2014 01:10 PM
Not yet. Is there any other place where you need that functionality, except BUILD_NUMBER?
6 Posted by Alxandr on 30 Jul, 2014 07:57 PM
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.
7 Posted by Alxandr on 24 Oct, 2014 12:00 AM
Any news on this?
Support Staff 8 Posted by Feodor Fitsner on 24 Oct, 2014 12:03 AM
Oh, is it still actual? :)
9 Posted by Alxandr on 24 Oct, 2014 04:29 AM
I still have "stupid stuff" like this in my appveyor.yml file:
What would really be helpful was if I could do environment variable
K_BUILD_VERSION: {build:0000}
ala C#string.Format
, 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 variableK_BUILD_VERSION
to equal the build number. Why this works other places and not in the environment variables I find strange.10 Posted by Lorenz Leutgeb on 23 Nov, 2014 10:30 PM
I'd like to do:
As suggested by this script except well, I want to have a declarative statement for that in my
appveyor.yml
.This is pretty much the same issue.
11 Posted by Lorenz Leutgeb on 23 Nov, 2014 10:44 PM
Correction: It works, I was just using
%BuildFolder%
instead of%APPVEYOR_BUILD_FOLDER%
. Maybe consider updateing your Go example on Bitbucket.Support Staff 12 Posted by Feodor Fitsner on 23 Nov, 2014 11:56 PM
OK, sure.
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:50 AM.