Octopack control package name

I there a way to control generated package name. I need to add some extra name settings, to separate 2 different projects on the octo manager
Thanks forward

Hi,

Yes, I believe you can now pass the MSBuild property OctoPackProjectName with a value to override the element. For example:

/p:OctoPackProjectName=YourProject

Paul

After passing the parameter, only 1 package is published in NuGet packager instead of 5 as it was before (

Hi Artdo,

Thanks for the reply. You can set the MSBuild property in your .csproj/.vbproj like this instead:

<PropertyGroup>
    <OctoPackProjectName>Foo</OctoPackProjectName>
</PropertyGroup>

This way you can have different values for different projects. Hope that helps!

Paul

Is there a way to rename one project using a MSBuild property to target the project you want to rename?

Can this property be be added to the docs?

Added - Thanks for the heads up Liam!

We have the need that when we do a build of our Feature Branch we want the packages names to be: for example: FeatureBranch-OurApp.nupkg

But for regular builds would still want it to be OurApp.nupkg. (Hence, setting it in the .csproj file wont work since he want this changed based on the build configuration we are running)

As artdo noted above, when we set this via /p:OctoPackProjectName=YourProject, only one package is created instead of the 2 that we need.

Any ideas?

Hi Adam,

Thanks for reaching out. The only way to do this using Octopack would be using a custom nuspec file: http://docs.octopusdeploy.com/display/OD/Using+OctoPack#UsingOctoPack-AddingaNuSpec

Regards,
Dalmiro

Follow-up from my above comment, I was able to achieve what I wanted by using OctoPackAppendToPackageId.
For example: /p:OctoPackAppendToPackageId=FeatureBranch

would yield:
OurApp.FeatureBranch.1.123456.5.nupkg

This fit our need perfectly!

Hi Adam,

I have to admit I totally forgot about that parameter. You should definitely be using that approach :slight_smile:

Cheers,
Dalmiro