mlurker
mlurker

Reputation: 149

What is the correct configuration of asp.net mvc + angular 4 + TFS 2013 (XAML builds) + octopack?

Configuring deployment process for the project and facing some issues with packaging the output of msbuild to a nuget package with OctoPack. Have decided to get a feedback about the process, may be I'm doing something wrong.

Preconditions:

Project structure:

The build process:

Msbuid compiles C# code, then executes publish command: compiles JS code and copies everything into a custom output folder.

To run build and generate an application, I run the following command (locally or on TFS server):

MSBuild solution.sln /t:Build /p:DeployOnBuild=true /p:Configuration=development /p:PublishProfile="development"

The output of this command contains everything I need (including Assets folder): I can take it and copy for IIS.

Now, I want to integrate Octopack. I've installed Octopack nuget package and added additional parameter /p:RunOctoPack=true:

MSBuild solution.sln /t:Build /p:DeployOnBuild=true /p:Configuration=development /p:PublishProfile="development" /p:RunOctoPack=true

Octopack creates a nuget package, but it doesn't have Assets folder. According to documentation, Octopack takes everything from \bin folder, but the Assets folder exists in obj\Development. And this is not a part of the solution, this folder is being re-created every time I run npm build task.

Now, questions:

  1. Does the process workflow look OK?
  2. Is publishing via msbuild is the only possible option? Are there any other ways to make msbuild compile C#, run custom cmd/powershell file (to run npm build) and transform web configs?
  3. How to include other folders into Octopack (in my case: Assets with compiled JS)?

Thanks for the feedback

Upvotes: 1

Views: 311

Answers (1)

Tom
Tom

Reputation: 2631

You can tell Octopack to add additional files by creating a nuspec file.

https://octopus.com/docs/packaging-applications/creating-packages/nuget-packages/using-octopack#UsingOctoPack-IncludingadditionalfilesusingaNuSpecfile(.nuspec)

In there you can add the paths of the files & directories you want included as part of the package.

So on your CI server, you'd want to do your client side bundling before the MS build process so that the files exsist.

Upvotes: 0

Related Questions