Creating a nuget library with octopus deploy

(Chase Lewis) #1

We have a shared library between multiple projects we want to use. I don’t want a post-build event to copy/move the files to ${OutputDirectory}\lib*.dll. It would make more sense imo just to do the translation within octopack to move everything in the output directory to an output of lib with a nuspec file.

I am using Octopack to build the nuget. Then pushing to our nuget server, not to octopus deploy like I would a web application.

However, I don’t want to define the version in the nuspec and instead want it to be defined by the team city build number. Is there a way to do that?

<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
  <metadata>
      <id>Titan.Shared</id>
      <title>Titan Shared Nuget</title>
     <version>{Can I put the octopus version number here somehow?}</version>
      <authors>Titan Dev Team</authors>
      <owners>Titan Dev Team</owners>
      <licenseUrl>http://alamode.com</licenseUrl>
      <projectUrl>http://alamode.com</projectUrl>
      <requireLicenseAcceptance>false</requireLicenseAcceptance>
      <description>shared library used for multiple titan projects</description>  
  </metadata>
  <files>
    <file src="bin\**\*.dll" target ="lib" />
    <file src="bin\**\*.pdb" target="lib" />
  </files>
</package>
(Robert Wagner) #3

Hi Chase,

You can do this by setting the version to $version$ in the file and passing the correct version at the command line to msbuild. See the OctoPack documentation for more information.

Please also see my response to your stackoverflow post.

(system) closed #4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.