Manticore
Manticore

Reputation: 1294

Sitecore config: reference variable config files

Is it possible to dynamically include config files into Sitecore.config based on environmental variables?

I thought of something like this

<sc.include file="/App_Config/custom.$(HOSTNAME).config" />

which then should be translated to

<sc.include file="/App_Config/custom.manticore.config" />

Given that the hostname is "manticore".

Upvotes: 1

Views: 610

Answers (2)

Jay S
Jay S

Reputation: 7994

As @jammykam mentions, SlowCheetah transforms can allow you to create environment-specific config files based on build configurations.

You can also use release management software that supports token replacement to manage environment variables. During release it will replace the tokens with the environment-specific value you want.

A few examples:

Upvotes: 1

Marek Musielak
Marek Musielak

Reputation: 27142

No, it's not possible.

There is a Sitecore Configuration Roles project on github ( https://github.com/Sitecore/Sitecore-Configuration-Roles ) which might be helpful though.

Remember that you need Sitecore CMS 8.1 rev. 160302 (Update-2) to use it.

Upvotes: 2

Related Questions