Bindings

My dev, staging and production environments each have different specific hostnames in their bindings. E.g. the deployment pushes three ASP.NET websites, and they are bound thus:
dev environment:
eDocClient site: http / client.dev2.edocbuilder.com / port 80; https / 172.16.7.40 / port 443
eDocCreator site: http / creator.dev2.edocbuilder.com / port 80; https / 172.16.7.41 / port 443
eDocengine site: http / engine.dev2.edocbuilder.com / port 80; https / 172.16.7.42 / port 443

staging environment:
eDocClient site: http / client-staging.edocbuilder.com / port 80; https / 172.16.7.81 / port 443
eDocCreator site: http / creator-staging.edocbuilder.com / port 80; https / 172.16.7.82 / port 443
eDocEngine site: http / engine-staging.edocbuilder.com / port 80; https / 172.16.7.83 / port 443

production environment:
eDocclient site: http / client.edocbuilder.com / port 80; https / 172.16.7.130 / port 443
eDocCreator site: http / creator.edocbuilder.com / port 80; https / 172.16.7.131 / port 443
eDocEngine site: http / engine.edocbuilder.com / port 80; https / 172.16.7.132 / port 443

As you can see each environment constructs its hostnames a bit differently: dev uses .dev. in the middle; staging uses -staging. in the middle; and production uses nothing in the middle. I can’t at the moment come up with a way to derive them from the Octopus variables I see. At the moment I’ve set up a separate Deployment Process step for each environment, just for this reason; so my process has nine steps when really only three things are done. Is there some other way? Store the hostnames in a file or something, or attach them to the machine definitions in Octopus?

Hi,

Thanks for getting in touch! You can use variables in bindings and scope them per environment.
Such as eDocSite scoped to dev and set as .dev2 and eDocClientHttps scoped to dev and set as 172.16.7.40 - then similar done for your other two environments. (You’ll need individual vars for each of your https but there is no avoiding that)
The in the binding the site set like: client#{eDocSite}.edocbuilder.com
And if you don’t set a scoped var for prod, it will just ignore that part.

Hope that helps!
Vanessa

Thanks, Vanessa! I dove into Variables and am truly impressed at the expressiveness they have. I’m back down to one step per package.

One thing I ran into though is that to create an SSL binding, the SSL certificate must be installed on that machine – IIS 8.5 Centralized Certificates can’t be used. :frowning: I see that it’s a suggestion on uservoice now, a little over a year old. I hope it gets accomplished for 3.0!

Perhaps a powershell script as an alternative. I really don’t want to need to create bindings manually when deploying to production.

Hi,

Damian is keen to have a look into Centralized Certs, but there is no room for it in 3.0. We will investigate for 3.1 to see its viability.

Vanessa