Multiple deployments to same folder, merge settings

I have a rather complicate deployment scenario and I’m hoping for some help in how to accomplish what i want.

  • I have a windows service that is deployed with Octopus.
  • I have several plugins for that service also deployed independently.
  • I have all the deployment folders pointing to the same location
  • The service and plugins use MEF, so all that is needed is to stop, deploy, start the service

The issue I’m having is how to merge all the setting, mainly connection strings, into the app.config file for the service

  1. The issue is that when the service itself is deployed, it overwrites the app.config files
  2. How do I merging my plugin specific settings without losing other settings.

Any ideas would be greatly appreciated.

~ Paul

Hi,

There are two approaches I might take to this:

The first would be to have Octopus deploy each plugin to different folders (using the default), and then using your PostDeploy.ps1 to copy the plugins to the right place and merge the XML settings.

The second would be to change the way plugins are configured by giving each a separate XML file, and having the plugin load its settings directly from its own file rather than the global app.config file. An example is here:

The benefit of the first approach is that it doesn’t require code changes, just a PowerShell script. The benefit of the second is that it might make things a bit simpler.

Hope this helps,

Paul