I’d like to dynamically generate or modify the bindings on a website I’m deploying. (It’s a multi-tenanted app with a relatively small number of businesses as customers. Each business that signs up gets to customize their own url.)
I’m currently doing this in octopus using a deployment process step with an arbitrarily large number of bindings defined based on variables for the hostname, SSL certificate and enabled flag. I populate those variables in a script step using Set-OctopusVariable. I find it annoying that I have to pre-configure the deployment step to support enough bindings needed at run-time.
Ultimately an option to preserve existing bindings would allow me to solve this in a more elegant way.
I think I could also use the IIS bindings backup and restore steps from the library, but I don’t like the idea of temporarily removing bindings during deployment. This discussion talks about writing a custom version of calmari, but I share the posters concern about maintaining that.
Is there any way to write a script to generate or modify the entire contents of the Octopus.Action.IISWebSite.Bindings property before the following step runs? My (limited) knowledge is that variables output from one step need to be included in subsequent steps as #{Octopus.Action[SetBindingsEnabled].Output.Enable2}
Are there any other more elegant ways to do this?
Thanks,
Matt