How do I add the commit sha to my version number?

mharen's Avatar

mharen

10 Mar, 2020 01:42 PM

On a Linux build I am trying to do something like this in my appveyor.yml:

version: 0.0.{build}+{APPVEYOR_REPO_COMMIT}
image: Ubuntu
...

The version property seems to accept only certain variables like build and branch. Are there others, like commit?

  1. Support Staff 1 Posted by Feodor Fitsner on 10 Mar, 2020 05:11 PM

    Feodor Fitsner's Avatar

    You can do like that:

    environment:
      build_version: 0.0.${APPVEYOR_BUILD_NUMBER}+${APPVEYOR_REPO_COMMIT}
    
    init:
    - appveyor UpdateBuild -Version ${build_version}
    
  2. 2 Posted by mharen on 10 Mar, 2020 05:20 PM

    mharen's Avatar

    Perfect, thank you.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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