Substring Variables

lapellanizlapellaniz Posts: 2
edited July 12, 2013 6:20AM in Deployment Manager
I am trying to find out if one can use regex or substring syntax when reading variables and assigning them to other variables.

I want to set the variable "RedGateWebSiteName" to be "CDS Console 4.0" where the "4.0" value comes from the "RedGateReleaseNumber" which is "4.0.1.250". I want to be able to substring a variable and assign that value to something else.

When we create a release, the value of that version includes major, minor, build (service Pack), revision. We use the major and minor only when setting names of sites. The database name includes the major, minor, build.

I can't create multiple releases with the same version value but use different package versions so I need to uniquely name the release version. I need only the first 2 numbers of the release version though to create some objects.

I am also wondering if one can set a variable defined via the deployment manager from a powershell script. I know I can read some variables but can I also set them?

Comments

  • We don't support regex or substring syntax when it comes to Deployment Manager variables. You can reference Deployment Manager variables from other variables as of version 2.0.8. So you can define '$RedGateWebsiteName' to be 'CDS Console $(RedGateReleaseNumber)' but that will create a website name ending with the release version.

    If you would like to create a website with only major and minor version, you can use postDeploy.ps1 powershell script which will be run after deployment. You can manipulate the website name after deployment from within this script.
    I am also wondering if one can set a variable defined via the deployment manager from a powershell script. I know I can read some variables but can I also set them?
    Sorry, we don't support setting of variables either.
    Chirayu Shishodiya
    Software Engineer - Deployment Manager
    Red Gate
  • Here is our documentation on powershell scripts, if you don't already know: http://documentation.red-gate.com/displ ... ll+scripts
    Chirayu Shishodiya
    Software Engineer - Deployment Manager
    Red Gate
Sign In or Register to comment.