Variable IIS bindings during deployments

I’m new to Octopus Deploy, so please forgive me if this question is a bit basic. I couldn’t see an easy way to do this…

I’m trying to setup deployments for multiple servers behind a load-balancer. We want all servers to have one binding e.g.
someurl.company.dev
Additionally, we’d like to have a character and a numeric binding to distinctly identify each of the deployment boxes. e.g.
a1.someurl.company.dev
a2.someurl.company.dev
a3.someurl.company.dev

a{n}…

I know I can setup variables based on the environment, but if I add a server, then I potentially have to hit every project that gets deployed to the new box to configure the variable.

Is there a variable that I can use that will increment by one for each server that we deploy to?

Thanks!

Hi,

Thanks for reaching out!

There’s not such variable unfortunately. What I would do in your case is use a part of the server name itself to setup the binding from a separate Powershell step after the site was created. Something like this:

  • Lets say your servers are called a1-WebServer, a2-WebServer, etc.
  • In your Powershell step you’ll first get all the chars that come after - of the machine name. So when you execute that in a1-WebServer, you’ll have a1, and so on.
  • In that same Powershell step (which will still be running on that same machine), use the string you got in the previous line to setup that binding.

I believe that using the machine name will be better than just increasing a value per server. As long as you have a logic server naming convention to back this up, you’ll never get confused as to which binding belongs to which server.

Please let me know if that helps somehow or if you have any questions.

Cheers,
Dalmiro