I’m trying to create automated deployments of assemblies. I have created a NuGet package of one project and can create the package with /p:RunOctoPack=true.
I’m running into trouble automating the publishing of my package to a feed. I would like it published to the feed of my (built-in) Octopus Deploy server. I managed to manually publish and manually deploy, but this is not enough for my needs. So my questions are:
How do I publish the NuGet package to the built-in feed from TFS Build definition?
How do I, through TFS, call the Process Steps I defined in Octopus Deploy? If that’s not what I should do please tell me the alternative.
THanks in advance for your help.
Hi Ralph,
Thanks for getting in touch!
You’re most of the way there. There are a couple of other MSBuild arguments you can use that tell OctoPack to push your package to the Octopus Nuget server.
Have a look at the Publishing section of the OctoPack documentation. You’ll want to use the /p:OctoPackPublishPackageToHttp=[your octopus server]/nuget/packages
and /p:OctoPackPublishApiKey=[your api key]
arguments as well as your /p:RunOctoPack=true
argument.
If you want to automatically create a release and start a deployment, you’ll also want to configure a Lifecycle and set up Automatic Release Creation.
Hope that helps!
Damian
Is /p:OctopusPackageVersion= necessary?
I should add that I had to renumber an assembly with a custom TFS build process template before. It was not trivial. Do you have a way around this, or guidance?
From: Ralph Compton
Sent: Wednesday, March 4, 2015 8:58 AM
To: 'Damian Brady’
Subject: RE: TFS 2013 and Automated Deployments of Assemblies [Questions #4278]
Is /p:OctopusPackageVersion= necessary?
Apparently not, if I’m using [assembly: AssemblyVersion(“1.0.*”)]. I should add that someone should make a big deal about the fact that your switch statements have changed and no error results indicate that the old switches are deprecated.
From: Ralph Compton
Sent: Wednesday, March 4, 2015 9:17 AM
To: 'Damian Brady’
Subject: RE: TFS 2013 and Automated Deployments of Assemblies [Questions #4278]
I should add that I had to renumber an assembly with a custom TFS build process template before. It was not trivial. Do you have a way around this, or guidance?
From: Ralph Compton
Sent: Wednesday, March 4, 2015 8:58 AM
To: 'Damian Brady’
Subject: RE: TFS 2013 and Automated Deployments of Assemblies [Questions #4278]
Is /p:OctopusPackageVersion= necessary?
Hi Ralph,
You’re correct, if you use the /p:OctopusPackageVersion
switch it will override the [assembly: AssemblyVersion()]
in the AssemblyInfo.cs file. If you’re using [assembly: AssemblyVersion("1.0.*")]
, it will use that version.
I’m not quite sure what you mean about our switch statements having changed. We’ve added new ones in the past, but they haven’t changed.
Damo
I mean this worked:
/p:RunOctoPack=true /p:OctoPackPublishPackageToHttp=http://146.61.80.145:8082/nuget/packages /p:OctoPackPublishApiKey=API-J4HTAPLNX0FGTU4GQEKUZNOHQ
And this didn’t:
/p:RunOctoPack=true /p:OctopusPublishPackageToHttp=http://146.61.80.145:8082/nuget/packages /p:OctopusPublishApiKey=API-J4HTAPLNX0FGTU4GQEKUZNOHQ
Hi Ralph,
Those switches have never changed to my knowledge.
Did you see documentation somewhere that uses Octopus
rather than OctoPack
? If there’s a typo somewhere, I’d like to fix it.
Damo
I copied the wrong switches from somewhere but I’m not sure whether it was StackOverflow or your site.