We have 15 to 20 customer environments (a mix of prod, UAT and testing environments for several different customers, some on the same physical machines, some on different ones). We are using the environment-per-customer mult-tenant concept ( as described here http://docs.octopusdeploy.com/display/OD/Multi-tenant+deployments).
This mostly works well, but we experience pain around managing variables. Since we have around 15 to 20 variables in our project that differ according to environment, dumping all the variables in the variables page of project and scoping by environment is not manageable. Instead, we create a variable-set per environment and scope each variable in a particular variable set to the same environment. So for example, we’d have a variable set called CUST_A_PROD and CUST_B_PROD and CUST_B_UAT. All variables in CUST_A_PROD variable set are scoped to the customer A prod environemnt.
This feels “hacky” because
A) It’s easy to forget to scope correctly.
B) It’s difficult to manage adding/removing variables if I change something in a step in the project
C) You can’t clone a variable set
D) I’d LOVE to be able to check in variables into source control so we can better changes on them
I know there are users out there who deploy with many more environments that we do. How are people managing their variables?
One idea I had was to put all my variables in a json file or something, check the file into source control, load them in in the first step using some powershell to parse the file and use Set-OctopusVariable (https://octopusdeploy.com/blog/fun-with-output-variables) and refer to the variables set in first step in the rest of my steps. But I haven’t come across anyone doing anything like that. Thoughts?