IIS Bindings use variables?

The new IIS Bindings look great - you can set the ipaddress/port and SSL thumbprint.
However, these settings vary by deployment environment!

For example, when deploying to staging that is not going to be the same IP address as production.
Also, I do have ssl certificates for the staging environments, but those are obviously different certificates than the public SSL ones.

One solution would be to let me use variables for the protocol, port, ipaddress and thumbprint. Then I could have the variables change by environment.

I guess I could create an entire new ‘deploy package’ step that was targeted at production - that would do it. Seems like a bunch of duplication…and if I do that, would not need clever things like #{Octopus.Environment.Name}.mywebsite.test.com as I would be making one step per environment.

Thoughts?

Working on this issue myself. For OD 1.6 we had a Deploy.ps1 which did all the IIS updating but now that it’s handled in 2.x nicer I’m working on updating the deploy scripts to help with the exact issue you mention (multiple bindings or environment specific bindings).

So, it looks like the IIS feature runs a script called Octopus.Features.IISWebSite_BeforePostDeploy.ps1 AFTER Deploy.ps1 and before PostDeploy.ps1 so I’ve moved my binding config to PostDeploy.ps1

So far no luck, but it’s the right direction - I’m just having trouble getting the binding to update: https://gist.github.com/kfrancis/8524444

Looks like I am going to have to do that to deal with virtual directories for now. The OD 2.0 makes it much nicer, but it needs to extend the bindings such that they can vary by environment!

To avoid writing powershell scripts, I ended up with (for now), EXACTLY duplicated process steps, except for the bindings (and which environment to run them in). Badly needed feature!

G’day! I think this is just a UI problem - I had no trouble deploying an IIS web site with variables in the various binding fields. (Be careful not to use the name Host for a variable, since it conflicts with a built-in PowerShell global.)

Can you let me know if this is what you’re after?

Thanks!
Nick

Yes, this works perfectly. Thanks!

I was trying to do this using a step template and it does not appear to be substituting the variable value.

Hi Ryan,

Could you please export your step template and upload it. You will need to upgrade to version 2.5.9 if it is not an email step.
I would need to see the use of the variable and the context to help you resolve this matter.

Vanessa