Red Gate forums :: View topic - DM Variables and Deploy.ps1
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
Deployment Manager
Deployment Manager forum

DM Variables and Deploy.ps1

Search in Deployment Manager forum
Post new topic   Reply to topic
Jump to:  
Author Message
fredendrix



Joined: 18 Dec 2012
Posts: 24
Location: Quebec (Canada)

PostPosted: Tue Dec 18, 2012 4:07 pm    Post subject: DM Variables and Deploy.ps1 Reply with quote

Hi!

Deployment Manager is a great tool and i'm almost done with all our CI setup. But a thing remains not clear, about variables in DM. Here's the scenario:

Ou changes are done directly on the Developpment database, that is under SVN using SQL Source Control.

Then, Teamcity grab it and the RedGate's command line utility (sqlCI.exe) package the new DB state and publish it on our nuGet server. I do NOT specify databaseServer and databaseName, since I would like to use DM Variables to specify those values, depending on wich environment I'd like to deploy ("Test" and so on...).

So the DB nuGet package contains the Powerscript file (Deploy.ps1), with $databaseServer and $databaseName variables in it. But what if I would like to specify those value in DM variables? I tried:

databaseServer
$databaseServer
$Deployment ManagerParameters["databaseServer"]
$Deployment ManagerParameters["$databaseServer"]

But neither seems to be "catched" by Powershell host while deploying, since I always get :

"ERROR: Define the variable "databaseServer""

Any help would be greately appreciated.
Thanks!
Back to top
View user's profile Send private message
Emma A



Joined: 30 Mar 2009
Posts: 40

PostPosted: Thu Dec 20, 2012 12:01 pm    Post subject: Reply with quote

Sorry for the delay in replying to this. The variable you need is databaseServer.

One thing to be aware of with releases that might be affecting you is that they are immutable, so even if you change the variables you must create a new release to pick up the new variable definitions.

If you look at the release you got the error on, you can expand the view variable snapshot link and see what values were used for that release. If you have not had chance to upgrade to the latest version of Deployment Manager you will encounter a bug, which is now fixed where you must click view variable snapshot twice for it to expand.

Deployment Manager looks for the most specific variable first. For example, you can define databaseName to be Development for the Development environment and then define another databaseName variable with the value NonDevelopment. NonDevelopmentwould be used for all environments other than Development.

A member of our Usability team would really like to talk to you, if you would be happy then please email DMSupport@red-gate.com and we can pass on your details.
Back to top
View user's profile Send private message
fredendrix



Joined: 18 Dec 2012
Posts: 24
Location: Quebec (Canada)

PostPosted: Thu Dec 20, 2012 5:10 pm    Post subject: Reply with quote

Ok thanks. This is probably the cause.

But now, when I try to package again with sqlCI.exe, the TeamCity runner could not reach the Deployment Manager anymore.

Seems that since i've updated DM server (1.0.12.3), sqlCI.exe returns this error :

System.Net.WebException: Unable to connect to the remote server.

Here's the parameters:

C:\SQLCI\sqlci --scriptsFolder=. --packageId=UnivBase --packageVersion=%build.vcs.number% --generateUpgradeScriptForCurrentlyDeployedVersions --deploymentManagerUrl=http://iisdevsvc:666/ --deploymentManagerApiKey=XXXXXXXXXXXXXX

If I paste the DM URL in web browser from build server, it works (no net error).

Any idea?[/i]
Back to top
View user's profile Send private message
fredendrix



Joined: 18 Dec 2012
Posts: 24
Location: Quebec (Canada)

PostPosted: Thu Dec 20, 2012 5:49 pm    Post subject: Reply with quote

Ok, here’s the DM server event log :

Application information:
Application domain: /LM/W3SVC/1/ROOT-1-130004907569641936
Trust level: Full
Application Virtual Path: /
Application Path: C:\Program Files (x86)\Red Gate\Deployment Manager\Portal\
Machine name: SRVIIS04

Process information:
Process ID: 6016
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
Exception type: ArgumentNullException
Exception message: Value cannot be null.
Parameter name: httpContext
at System.Web.HttpContextWrapper..ctor(HttpContext httpContext)
at Glimpse.Core.Extensibility.GlimpseTimer.get_TimerMetadata()
at Glimpse.RavenDb.Profiler.StopTrackingStore(Object sender, EventArgs e)
at Raven.Client.Document.DocumentStore.Dispose()
at Autofac.Core.Disposer.Dispose(Boolean disposing)
at Autofac.Util.Disposable.Dispose()
at Autofac.Core.Lifetime.LifetimeScope.Dispose(Boolean disposing)
at Autofac.Util.Disposable.Dispose()
at RedGate.Deploy.Portal.MvcApplication.Application_End()
Back to top
View user's profile Send private message
Emma A



Joined: 30 Mar 2009
Posts: 40

PostPosted: Thu Dec 20, 2012 5:56 pm    Post subject: Reply with quote

We have just released an update to the TeamCity plugin via check for updates. Please could you try upgrading to that and see whether this issue still occurs.
Back to top
View user's profile Send private message
fredendrix



Joined: 18 Dec 2012
Posts: 24
Location: Quebec (Canada)

PostPosted: Thu Dec 20, 2012 8:23 pm    Post subject: Reply with quote

Oh great! Using TeamCity NuGet repository works just fine with sqlCI.exe and DM.

You can close tickets about sqlCI.exe problems and DM variables (Deploy.ps1).

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group