Using variables when developing locally

Sorry if this question has already been asked, I couldn’t find anything so I thought I would ask.

It’s more a question about implementation pattern. I need to splice in some service URL’s t to the Web.config file and I can see that this is achievable and have managed it using the #{variable} notation, this is great (and also super easy to work with :slight_smile:

My problem comes on my local environment. From what I can see for Octopus to pick up these variables to splice they need to be in the config as something like:

<endpoint address="#{BaseURL}/somecommonfolderstructure/endpoint.svc" />

When I deploy to a server I can replace using octopus the BaseURL and it works perfectly. But my question is what happens on local? Or more precisely what pattern do you suggest for working with variables like this locally? So that I can just run my app from visual studio and it will not fall over because the endpoint is literally “BaseURL”.

Hope this makes some sense.

Thank you

Hi Bradley,

We’ve encountered this too; in Octopus 2.4 we’ve changed the order of evaluation of config file transforms and substitutions, so that you’ll be able to put the {#BaseURL} token in e.g. Web.Release.config and then Octopus will:

  1. Apply the transformation, placing the token into the “real” config file, then
  2. Perform variable substitution

I think this solves the problem - how does it sound to you?

Regards,
Nick

Thank you for the prompt and helpful response. Do you have a time frame on when 2.4 will be available?

Thanks
Bradley

Hi Bradley,

It should be out as a pre-release within the next week. Hope that helps!

Paul

That is great. Thanks very much :slight_smile: