C# – In which cases build artifacts will be different in different environments

asp.netccontinuous integrationdeploymentrelease

We are working on automation of deployment using Jenkins. We have different environments – DEV, UAT, PROD. In SVN, we are tagging each release and placing same binaries in DEV, UAT, PROD. The artifacts already contains config files w.r.t each environment but I am not understanding why we are storing binaries in environment folder again. Are there any scenarios where deployment might be different for different environments.

Best Answer

There are a number of scenarios where your deployment could be different per environment:

  1. Which machines are being deployed to (obviously).
  2. Config files (you mentioned this).
  3. Number of machines (or VMs) per environment.
  4. Load balancer.
  5. Network configurations.
  6. Authentication.

There could be lots of others, but it's hard to say without more info on your specific project.

As for storing binaries, it is fairly common to store build artifacts somewhere, but I'd recommend using an actual artifact repository rather than a "source code repository" like SVN. You'd have build jobs that create the artifacts (release or in-progress) and put into the repository. Then you'd have other jobs that deploy the artifacts to servers. You can combine them, but that gets to be a lot on one job and you start losing granularity.

(Aside: I've got some experience using Maven, Nexus, and Jenkins for C# webservices... but that's some real craziness for most .NET developers. But once you've got Maven working for you in .NET-land -- instead of against you -- then you gain some neat benefits.)