Get build version from an external source

tugberk's Avatar

tugberk

15 Oct, 2014 10:43 AM

Is it possible to provide the build version from an external source?

For example, I would like to get the build version by looking at my project.json file. I was thinking something like this:

version: ps: $prjObj = (get-content src\MyApp\project.json) -join "`n" | ConvertFrom-Json; return "$($prjObj.version).{build}"
  1. Support Staff 1 Posted by Feodor Fitsner on 16 Oct, 2014 03:58 AM

    Feodor Fitsner's Avatar
  2. 2 Posted by tugberk on 16 Oct, 2014 06:25 PM

    tugberk's Avatar

    nice, thx! at which stage should I run this powershell code? before the clone starts? do you have a .appveyor file example which uses this?

  3. Support Staff 3 Posted by Feodor Fitsner on 16 Oct, 2014 06:29 PM

    Feodor Fitsner's Avatar

    You can call it at any place of your build and any number of times.

  4. 4 Posted by gep13 on 17 Oct, 2014 07:06 AM

    gep13's Avatar

    Note, you may also want to make use of this method:

    http://www.appveyor.com/docs/build-worker-api#set-variable

    Which would allow you to store the external build version as an environment variable, which can then be used in later build steps and scripts.

  5. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:49 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