Substring Variables

Automated deployment for web applications and databases

Moderators: Mike Upton, justin.caldicott, Sean.newham, csmith, chirayu, DavidSimner, david.conlin

Substring Variables

Postby lapellaniz » Wed Jul 10, 2013 4:50 pm

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?
lapellaniz
 
Posts: 1
Joined: Wed Jul 10, 2013 4:41 pm

Postby chirayu » Fri Jul 12, 2013 11:06 am

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
chirayu
 
Posts: 68
Joined: Mon Sep 17, 2012 5:48 pm

Postby chirayu » Fri Jul 12, 2013 11:20 am

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
chirayu
 
Posts: 68
Joined: Mon Sep 17, 2012 5:48 pm


Return to Deployment Manager

Who is online

Users browsing this forum: robin and 0 guests