Auto-Deploy Visual Studio 2010 Database

Visual Studio 2010 has a nice database project feature that allows you to deploy a database, as well as configure various environments based on your configuration (create a deployment, etc.).

I would like to integrate this into our automated build environment.

Firstly, after starting the deployment of the script after successful build on my local machine. (That way, I can go straight to running unit tests)

Then, by deploying the script after a successful build on our build server. so that any circuit changes necessary for device testing and integration will be implemented.

How to configure MSBuild or similar to run them in deployment mode.

+3
source share
1 answer

Use the task MSBuildto call the dbproj file. Pass "DBDeploy" as the target and assembly configuration as a property, for example:

<MSBuild Projects="MyDb.dbproj" 
         Targets="DBDeploy" 
         Properties="Configuration=$(Configuration)" />

On the build server, you may also need to provide properties such as TargetConnectionStringand TargetDatabase.

+4
source

Source: https://habr.com/ru/post/1767984/


All Articles