Managing large number of environments to the same machine

Automated deployment for web applications and databases

Moderators: Mike Upton, justin.caldicott, Sean.newham, csmith, chirayu, DavidSimner, david.conlin

Managing large number of environments to the same machine

Postby samjudson » Mon Aug 18, 2014 12:01 pm

Hi

I wondered if anyone could help.

We have a large solution which contains multiple components (2 web sites and various services).

The same solution is used to deploy 5 different 'projects'. This is handled via different config files and various XML transformations as part of the build process. We also have multiple environments that we deploy to (Alpha, QA, Beta etc). Each project is basically a geo-location version of a web site with different features etc.

We have a configuration setting for each project/environment pair, e.g. ProjectA-Alpha, ProjectA-QA, ProjectA-Beta, ProjectB-Alpha etc.

In deployment manager we have had to set up a single environment for each project/environment pair so that the configuration transformations happen correctly. This means that Project A deploys to ProjectA-Alpha, ProjectA-QA etc, even though they are the same target machine (e.g. IIS-1, SVC-1 and SVC-2 for example).

What would be really helpful is if there was a way to overwrite the configuration transformation setting as a variable, or to be able to update the RedGateEnvironmentName as part of the release.

We are currently adding Project 5 to the mix, meaning we have 5 projects and hence 15 environments (Alpha, QA and Beta for each), even though we only have 3 actual target machines.

Anyone any ideas on how we might manage this, or if this could be added as a new feature to deployment manager?
samjudson
 
Posts: 8
Joined: Tue Jan 14, 2014 10:30 am

Postby Mike Upton » Fri Aug 22, 2014 6:52 pm

Hi,

I think your best option here would be to use a Deploy.ps1 PowerShell script to modify the necessary config files. PowerShell scripts can make use of the values in deployment variables, and can be used to modify XML files.
Mike Upton

Software Engineer
Red Gate Software Ltd.
Mike Upton
 
Posts: 157
Joined: Wed May 11, 2011 8:04 am
Location: Red Gate

Postby samjudson » Fri Aug 22, 2014 10:29 pm

Yes, that's certainly an option, but then I'd need to deploy an app to do the transformations as well.

Plus deployment manager does such a good job of transforming the config files (plus other xml files) automatically it would feel a bit of a waste to replace all of that functionality with something I had to write myself.
samjudson
 
Posts: 8
Joined: Tue Jan 14, 2014 10:30 am

Postby Mike Upton » Mon Sep 08, 2014 5:36 pm

You can combine the options together, so you might be able to get to what you want by using a combination of operations. The operations are run in the following order:
  1. PreDeploy.ps1 - you could swap in different transform files based on the value of a variable here. This would effectively give you what you want - the ability to change the transform file based on a variable value.
  2. XML Transformations for large-scale per-environment changes
  3. Then Variable substitutions in appSettings and connectionStrings - these can obviously be based on more than just the environment name.
  4. Finally, Deploy.ps1 can perform XML operations directly on .config files using the PowerShell XML APIs

Hopefully combining these should get you what you want. If you need more than this functionality, please add a feature request in UserVoice.

Kind Regards,
Mike
Mike Upton

Software Engineer
Red Gate Software Ltd.
Mike Upton
 
Posts: 157
Joined: Wed May 11, 2011 8:04 am
Location: Red Gate

Postby samjudson » Tue Sep 09, 2014 10:02 am

Ah, so PreDeploy happens before the XML Transformations - that is useful to know, thanks.
samjudson
 
Posts: 8
Joined: Tue Jan 14, 2014 10:30 am


Return to Deployment Manager

Who is online

Users browsing this forum: No registered users and 0 guests