Is it a good practice to package jar and config for all environments (dev uat prod) in one zip?

I am writing software deployed on unix servers by some operations team. The software is deployed to different environments by ops. Namely dev, uat and prod.

The executable will be configured differently on each environment thus env specific config files.

I need the process to be as simple as possible, as well as limiting the potential for human errors (simplicity definitely has a big impact on the latter).

One major advantage of the approach described in the title and reflected belowis that the deployment run book is environment independent. And the runbook is therefore ultra simple :

Login to the target deployment machine Curl the zip file Unzip it Run the executable with config wanted (dev, uat or prod)

Example of my current zip :

Executable jar file
App-dev.properties
App-uat.properties
App-prod.properties

I'm checking my options and looking for recommendations on best practices to make deployment as simple as possible and yet minimizing human error impact.

Answers


I don't think that good practice / bad practice come into it. If it works for you, do it.

I presume that the real reason you are asking is to find out if there are any possible drawbacks. The only ones I can think of are:

  • If the configs include passwords or secret keys, then having an omnibus ZIP file in non-production machines is potentially exposing the production keys/passwords more than they need to be.

  • This will result in more "versions" of the ZIP existing which might result in more issues with tracking them. (Probably not though ... as there should be ways to deal with this.)

  • (From thkala's comment) If you include the production configs in the ZIP file used on other platforms, there is a risk that someone might accidentally deploy a "production" system on a non-production platform. That could potentially have disastrous consequences; e.g. trashed production databases or security issues.


Need Your Help

Build on TFS 2013 failed but okay locally

tfs msbuild nuget visual-studio-2013 tfs2013

When I checked in the code, TFS 2013 built the solution automatically. It is okay in local VS 2013 but failed in TFS.

java.util.zip.ZipException: too many entries in ZIP file

java zip large-files unzip

I am trying to write a Java class to extract a large zip file containing ~74000 XML files. I get the following exception when attempting to unzip it utilizing the java zip library: