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:
- .net 4.6 asp.net project with Angular 4 frontend and Angular-cli as a build tool
- TFS 2013 (with XAML build) as a build machine
- GIT as a source code
- Octopus as a deployment framework
- There are several environments, so have several web configs with transformations for asp.net and for angular-cli/webpack
- several publish profiles that include (one per each environment):
- PreBuild Event tag to run: npm run build
Project structure:
- web_project
- \src - typescript, html and scss files
- \images
- \assets - this folder is not a part of the project/GIT. It is created by angular-cli/webpack and contains compiled, minified and bundled js code and css files
- \other files (index.html, web.config etc)
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:
- Does the process workflow look OK?
- 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?
- How to include other folders into Octopack (in my case: Assets with compiled JS)?
Thanks for the feedback