Visual Studio 2010 自动化数据库部署
在 Visual Studio 2010 中,数据库项目有一个很好的功能,允许您部署到数据库以及根据您的配置设置各种环境(构建部署等),
我想将其集成到我们的自动化构建环境中。
首先,在我的本地计算机上成功构建后运行部署脚本。 (这样我就可以直接运行单元测试)
然后在构建服务器上成功构建后运行部署脚本。以便单元测试和集成测试所需的任何架构更改都将运行。
如何调整 MSBuild 或类似工具以在部署模式下运行它们。
In Visual Studio 2010 there is a nice feature of the database project that allows you to deploy to a database as well as set up various environments based on your configuration (Build deploy etc)
I Would like to integrate this into our automated build environment.
Firstly by having the deploy script run after a successful build on my local machine. (So I can go straight into running the unit tests)
Then by Having the deploy script run after the successful build on our build server. so that any schema changes required for the unit and integration tests will run.
How can I adjust the MSBuild or similar to run these in deploy mode.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
MSBuild
任务调用“dbproj”文件。将“DBDeploy”作为目标传递,并将构建配置作为属性传递,例如:在构建服务器上,您可能还需要提供诸如
TargetConnectionString
和TargetDatabase
之类的属性。Use the
MSBuild
task to call the "dbproj" file. Pass "DBDeploy" as the target and the build configuration as a property, e.g.:On a build server, you might also need to supply properties like
TargetConnectionString
andTargetDatabase
.