Customize nuget version

asfad.anwar's Avatar

asfad.anwar

11 Aug, 2017 05:32 PM

I had setup continuous integration with TFS2013 using OctoPack but when build is trigger getting different version number but we would like to customize build version as per our build release for Eg 1.0.1.0 or 2.0.1.0.
can you please help me to define version number as per our requirement.

Thanks,
Asfad

  1. 1 Posted by asfad.anwar on 11 Aug, 2017 05:34 PM

    asfad.anwar's Avatar

    
    Thank you for your email : I am on PTO and I will be back to the office on 16/August/2017, with no access to emails.
    I will respond to your emails as soon as possible upon my return.

    ________________________________

    This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.
    ______________________________________________________________________________________

    www.accenture.com

  2. Support Staff 2 Posted by Dalmiro Grañas on 13 Aug, 2017 02:57 AM

    Dalmiro Grañas's Avatar

    Hi Asfad,

    Thanks for reaching out! This doc explains how Octopack decides which version should be assigned to your package, and how to override it with whatever you want: https://octopus.com/docs/packaging-applications/nuget-packages/usin...

    What you want to do is use the first option and use the MSBuild parameter /p:OctoPackPackageVersion=[build variable] to define the package version. It'll be up to you to figure out which build variable you want to use along with that parameter.

    Best regards,
    Dalmiro

  3. 3 Posted by asfad.anwar on 15 Aug, 2017 04:21 PM

    asfad.anwar's Avatar

    Hello Dalmiro,
    Below is the argument I had passed in, can you please define the parameter for package version so that i will copy and paste the same.

    /p:RunOctoPack=true /p:OctoPackPublishPackageToHttp=https://deploy.energyservices.accenture.com/nuget/packages /p:OctoPackPublishApiKey=API-M7B6OMDYTYTQEDISFSCO1LYDDDA /p:OctoPackProjectName=ETHOS

  4. Support Staff 4 Posted by Dalmiro Grañas on 15 Aug, 2017 05:51 PM

    Dalmiro Grañas's Avatar

    Hi,

    As mentioned before. the parameter you'll need to pass is /p:OctoPackPackageVersion=[variable] . The tricky part is figuring out which variable you want to pass to that parameter. From memory (TFS2013 is pretty old by now) the variable that held the build ID was $(TF_Build_buildNumber). Then you were supposed to define the format of that variable in your build definition like this. Keep in mind that whatever you pass to /p:OctoPackPackageVersion needs to be semver compliant

    If the build definition setup goes will, In the end you should end up using /p:OctoPackPackageVersion=$(TFS_Build_BuildNumber)

    I used this page I found online to refresh my memory about this old TFS version. It shows a bit how to modify this system variable and make it hold the value you want: http://www.dotnetcurry.com/visualstudio/1035/environment-variables-...

    Sorry if you were looking for a simple Copy/Paste reply and I ended up giving you more homework :(.

    Best regards,
    Dalmiro

  5. Support Staff 5 Posted by Dalmiro Grañas on 15 Aug, 2017 05:56 PM

    Dalmiro Grañas's Avatar

    I noticed from your email signature that you are part of Accenture. I know from experience that your company has a pretty good devops team in charge of maintaining your TFS and Octopus Servers. I'm pretty sure that if you contact them, they'll have more info about tweaking this xaml-based build definitions in order to get a variable with the value you want. I know at least Ian Paullin and Thadd Parker are part of that team and will be able to put you in contact with someone that can help 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