Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Setting variables per Deployment environment
-
I wish to change a value in my web.config i.e. DatabaseConnectionString per deployment environment.
Currently I have different variables that I reference in each deployment to handle this i.e. TestConnectionString, LiveConnectionString. These are then referenced in a action group with the one for Live effectively a copy of Test but just with the variable name changed.
Is there a way by which I can have just ConnectionString and set that variable on an environment by environment deploy thereby just copying an action group but not needing to change it's contents?
Product: BuildMaster
Version: 4.2.5
-
Hi Andre, I think I understand... you want to use a single variable, but have the value vary by environment? If so, then yes -- actually that's a very common use-case.
-
Yes that's exactly what I want. At the moment the only way to do this from what I can see is to create completely different variables and reference those in the action step.
However I would prefer to have one action step i.e. Replace Connection string. And this action step uses the variable ConnectionString. That variable itself is then set somewhere relating to the environment it is imported into.
Is this possible as I can't seem to find any info on it?
Hope that makes sense.
-
Just name your database connections something like: "SQL-Integration", "SQL-Testing" (using the environment names). Then in your "Execute Database Change Script" (or whichever database action you're using), enter the name of the database connection as
SQL-${EnvironmentName}