GitHub tag created with .buildNumber

feldman.sean's Avatar

feldman.sean

01 May, 2017 05:42 AM

Hello,
I'm trying to use continuous deployment mode and each commit to master to increase the patch version.
This is failing due to tag pushed by AppVeyor is of "major.minor.patch.buildNuber" and I'm not sure how to get rid of the last part.
GitVersion file: https://github.com/paolosalvatori/ServiceBusExplorer/blob/master/GitVersion.yml
AppVeyor file: https://github.com/paolosalvatori/ServiceBusExplorer/blob/master/appveyor.yml

  1. Support Staff 1 Posted by Ilya Finkelshte... on 01 May, 2017 10:38 PM

    Ilya Finkelshteyn's Avatar

    Hi Sean,

    Could you please check tag name setting? You can hard-code it or use environment variables to combine what you need.

    I hope I understand your issue correctly. Let us know if this helps.

    Ilya.

  2. 2 Posted by feldman.sean on 02 May, 2017 06:56 AM

    feldman.sean's Avatar

    Hi Ilya,

    Thank you for the link. Release every tag build is the option I'm after. Unfortunately, rather than pushing my tag created by GitVersion, the tag pushed by AppVeyor is set to "major.minor.patch.build.number" (e.g. 4.0.83.build.161). Ideally, I'd like to see AppVeyor pushing just "major.minor.patch" (e.g. 4.0.83).

  3. Support Staff 3 Posted by Ilya Finkelshte... on 02 May, 2017 11:54 PM

    Ilya Finkelshteyn's Avatar

    Hi Sean,

    By default AppVeyor uses value of appveyor_build_version variable. GitVersion sets this value to what you see. You can check it by adding echo %appveyor_build_version% before and after gitversion command.

    So you have 2 options:
    - make gitversion generate version you need - fix gitversion-generated value by creating new variable with unneeded part cut, like $env:myVar = [System.String]::Join(".", $env:appveyor_build_version.Split("."), 0, 3) and then use that myVar as tag in GitHub publishing settings.

    Ilya.

    
    
  4. 4 Posted by feldman.sean on 03 May, 2017 05:11 AM

    feldman.sean's Avatar

    Hi Ilya,

    Thank you again. What I've done is the following:

    deploy:
      - provider: GitHub
        tag: $(GitVersion_MajorMinorPatch)
        on:
          branch: master

    This gets the format I need w/o additional PS tweaks since GitVersion sets
    that environment variable OOTB.

    Thank you again.

    Kind regards,
    Sean Feldman

  5. Support Staff 5 Posted by Ilya Finkelshte... on 03 May, 2017 04:19 PM

    Ilya Finkelshteyn's Avatar

    Oh, great, this is much more clean! I added this to my notes (not familiar with GitVersion yet).

    Ilya.

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