Reputation: 5366
Is it possible to deploy a VS 2010 database project using TeamCity?
I am building my whole solution, and deploying a website to my server, this all works fine.
The final step I want to trigger is the deploy of the database project which generates a sql script and deploys it.
I have the "Create a deployment script (.sql) and deploy to the database" option selected as a deploy action, my Configuration target is set to build and deploy the database project, but I just can't figure how to get TeamCity and MSBuild to trigger it.
Upvotes: 12
Views: 3442
Reputation: 21224
Visual Studio must be installed for this to work.
For the original SQL Server 2005/2008 Database Project types:
C:\Program Files\Microsoft Visual Studio 10.0\VSTSDB\Deploy\VSDBCMD.exe
. Set Command Parameters to /a:Deploy /dd:+ /manifest:%system.teamcity.build.checkoutDir%\<PROJECT PATH>\sql\debug\<PROJECT NAME>.deploymanifest
. (See here for VSDBCMD.exe parameters).For the SQL Server Database Project provided by SQL Server Data Tools or Visual Studio 2012/2013:
C:\Program Files\Microsoft Visual Studio 10.0\Microsoft SQL Server Data Tools\sqlpackage.exe
. See here for sqlpackage.exe parameters. Here's an example with the deployment settings stored in an XML file (created via the Publish option): /Action:Publish /SourceFile:%system.teamcity.build.checkoutDir%\<PROJECT PATH>\bin\Debug\<PROJECT NAME>.dacpac /Profile:%system.teamcity.build.checkoutDir%\<PATH TO PROJECT>\PublishSettings.xml
.Upvotes: 16
Reputation: 5366
Since my question got upvoted today, I'm revisiting with the answer I found.
I did the following:
Edit 16/11/12: Another upvote, so revisiting again. Since I posted this, things became a bit clearer. I was originally running TeamCity on my dev PC.
When I came to move it onto a server, the only way I could get the database deploy to work was to install Visual Studio on the server which is a pain.
Upvotes: 10