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.

  1. There are built-in variables for both build version and number: http://www.appveyor.com/docs/environment-variables

  2. 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.

  3. Right, environment section does not expand variables in values. I will add an issue to fix that.

  4. Was this ever fixed?

  5. Not yet. Is there any other place where you need that functionality, except BUILD_NUMBER?

  6. 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. Any news on this?

  8. Oh, is it still actual? :)

  9. I still have "stupid stuff" like this in my appveyor.yml file:

      - set K_BUILD_VERSION=000%APPVEYOR_BUILD_NUMBER% #temp
      - set K_BUILD_VERSION=%K_BUILD_VERSION:~-4%
    

    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 variable K_BUILD_VERSION to equal the build number. Why this works other places and not in the environment variables I find strange.

  10. I'd like to do:

    environment:  
      - GOPATH: %BuildFolder%
    

    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. Correction: It works, I was just using %BuildFolder%instead of %APPVEYOR_BUILD_FOLDER%. Maybe consider updateing your Go example on Bitbucket.

  12. OK, sure.

  13. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:50 AM.

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

Recent Discussions