Using NuGet packager with Grunt output
In my TeamCity build configuration, I have a Grunt step that generates our app's index.html from a index.template.html in source control.
In the next step, we create a NuGet package and deploy it.The NuGet package should obviously contain the newly generated index.html.
But:
- If I put index.html file in source control and have it overriden by Grunt in the TeamCity checkout folder, the NuGet packager will use its source control version and not the Grunt-generated version
- If I remove index.html from source control, the NuGet packager will not put it in the output .nupkg file at all
What is the right way to do things in this case?
Please sign in to leave a comment.
Hi Ion,
> If I put index.html file in source control and have it overridden by Grunt in the TeamCity checkout folder, the NuGet packager will use its source control version and not the Grunt-generated version.
It sounds strange. NuGet does not checkout any files from VCS, it just uses files from working folder. Please double check that the file is actually modified/created during the Grunt step.
Alina,
However strange, that is how that works in my case...
- index.html in $TFS\[app path.. ]\Sources\Web\App: "<body>Hi from TFS!</body>"
- index.html in C:\TeamCity\buildAgent\work\c7a97ec3c7a58ff0: "<body>Hi, I was generated by Grunt!</body>"
BUT:
- index.html in the generated NuGet package > Web_5dwerw[...].cssx\approot\App\index.html: "<body>Hi from TFS!</body>"
This is the output of the TeamCity's Build Log:
[pack] NuGet command: C:\TeamCity\buildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe pack C:\TeamCity\buildAgent\work\c7a97ec3c7a58ff0\Sources\BuildAndDeploy\ServiceConfiguration.Internal.nuspec -OutputDirectory C:\TeamCity\buildAgent\work\c7a97ec3c7a58ff0\Deploy -BasePath C:\TeamCity\buildAgent\work\c7a97ec3c7a58ff0 -Version 0.0.27.311 -Properties
Configuration=Release
My nuspec file does not contain any reference to index.html or its parent folders.
I am using NuGet Pack 2.8.3
Ion,
Could you please attach the nuspec file? Why do you create index.html in C:\TeamCity\buildAgent\work\c7a97ec3c7a58ff0, but not modify it in $TFS\[app path.. ]\Sources\Web\App?
The problem is somewhere else, I discovered:
- the Visual Studio solution contains an Azure Cloud project
- the NuGet package contains a .cspkg file ("Windows Azure Package" - http://stackoverflow.com/questions/15618251/how-to-create-a-cloud-service-package-cspkg-and-cloud-service-configuration-f)
So, at the moment, I can't figure out how to tell TeamCity that this .cspkg file needs to include a file called index.html, which is generated by a previous grunt step in the TeamCity checkout folder. It all works fine if index.html is included in source control, but I don't want it it source control, as it's a generated file.