Question

I'm currently using Teamcity 7.x, and we're not ready to upgrade yet.

For our internal NuGet packages, my specifications are relative to the location of the nuspec file (as per default), but when run in the NuGet Pack runner, they must be relative to the build checkout directory.

For example, I should have a nuspec containing this:

<files>
  <file src="Content\**" target="content" />
</files>

but that won't work in TeamCity as it automatically adds a BasePath option, so I have to change my nuspec to this:

<files>
  <file src="Source\Project\Content\**" target="content" />
</files>

How can this be avoided? I can have my specifications changed, but I have a number of packages created in a single build step, and I'm trying to use the new -IncludeReferencedProjects option, but that fails as it looks in the wrong place.

The BasePath option is not needed, so why does it default to the build checkout directory?

Was it helpful?

Solution

Per the following documentation, step 2, bullet 3: http://confluence.jetbrains.com/display/TCD7/NuGet+Pack

  • Specify base directory, where the files defined in the nuspec file are located (the directory against which the paths in from nuspec are resolved, usually some bin directory). If left blank, TeamCity will use build checkout directory as base directory.

You may try adjusting this setting to the root of your project (theoretically the same location as your nuspec file), rather than the build checkout directory (default).

OTHER TIPS

Maybe you can try use octopack,
source codes: https://github.com/OctopusDeploy/OctoPack
how to install: http://octopusdeploy.com/documentation/integration/teamcity

You dont need using octopus deploy. You can using only octopack for create nuget package.This plugin directly upload your package native teamcity nuget server.

good lucks!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top