Setting up my VSTS build environment

in vsts •  7 years ago 

This is a summary of nightmares and preferences. This is a C# ASP.NET MVC Core project.

The do not list

1. Do not assume that because it builds locally, it will build and deploy from the VSTS services.

  1. The items below are breakdowns of the issues.

2. Do not assume that the file path selector in the VSTS configuration tool knows how to work correctly.

  1. When I had to pick the path to my package.json file, the selector allows me to actually pick the file, which then gets added to the path. This results in VSTS to look for the file under [my project name]/package.js/package.js. How stupid is that.

3. Do not assume that VSTS will use the right version of NuGet.

  1. I don’t know what version the build is defaulting to, but I had to add a task to install 4.5.1 to get the build to work.

4. Do not assume that VSTS will use the right version of NodeJs

  1. I had to specify download of Node 6.x or later to get Gulp to work.

5. Do not assume that VSTS will know how to execute your gulp script.

  1. I had to specify the task names, because it defaults to ‘default’ if you don’t specify one.

6. Do not assume that your 3rd party developer is doing their job right.

  1. I found several 3rd party NuGet packages claimed to be core, but yet had strong dependency on framework
  2. I ended up creating another root solution folder called DependancyLibraries. These projects are the source code of the 3rd party projects that caused build issues. So I force the build to be compatible with what I need. I then go to my deploy project and just point to these dependencies to pull from rather than from NuGet.

My Execution Pattern

  1. Set Use Node to 6.x
  2. Use NuGet to 4.5.1
  3. npm install
  4. gulp execution This helps to make sure that I have no NuGet dependencies in my gulp builds.
  5. NuGet restore
  6. Build solution
  7. Publish Symbols
  8. Publish Artifact
  9. Azure App Deploy

Closing notes

I am not looking forward to converting this project over to using WebPack. I am terrified as to what new issues I am going to run across.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!