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?