Creating Variables from file input

Hi,

I am wanting to create my first SSIS deployment project. As a part of this project I will be deploying the .dtsx folder the correct directory. It will also copy the .dtsconfig file to the same directory.

However I need to correctly substitute the values within the dtsconfig file appropriately for each environment.

There will be variables that we centrally control within the variables section such as SERVERNAME, SMTPHOSTNAME, SHAREFOLDERPATH, etc

However there will be ones that will be set by the developers such as EMAILTO, EMAILFROM, EMAILSUBJECT, etc which we will be wanting them to define somewhere a values for each variable for each environment.

Therefore I have been looking for a way to be able to include a file in the Octopus package that will contain variables and the value relating to each environment. Octopus can then read that in to the deployment and then substitute the dtsconfig files for each different environment.

E.g the EMAILTO value in dtsconfig deployed to the DEV environment would have developersname@domain.com

EMAILTO for the TESTING Environment would have testers@domain.com

EMAILTO for PROD would have the real email address

I was hoping that I could has an XML or REST file which would then create Octopus variables and the individual values for each environment which I could then use in the substitution at the time of deployment specific to the individual environment being deployed to.

Thoughts?

Hi,

Thanks for getting in touch! I may be oversimplifying your setup here, but it sounds like you are after Scoped Variables and possibly some System Variables.

Scoping variables allows you to automate which variable Octopus should use in any given deployment. For example, you can scope the SERVERNAME to a certain Environment, which allows Octopus to automate which SERVERNAME to use when it deploys to Dev/Test/Prod, etc.

You may already be onto the Scoped Variables, but something that sounds like it would help is our System Variables. You can create a variable with something like

Variable Name: EMAILTO
Variable Value: Octopus.Deployment.CreatedBy.EmailAddress
Variable Value: testers@domain.com
Variable Value: prodemail@domain.com

WIth this, you could create multiple variable values. So if your PROD server needs a specific EMAILTO value, you could define it under the project variable EMAILTO and scope that specific value to PROD. You could scope the above system variable value to DEV and have a third value of testers@domain.com scoped to the TESTERS environment.

Some further reading on variable substitutions that may help you here.


Let me know if this helps or if you have any further questions at all.

Best regards,
Daniel

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.