为 Dacpac 和 Powershell 脚本创建 Nuget 包 [英] Create Nuget package for Dacpac and Powershell script

查看:57
本文介绍了为 Dacpac 和 Powershell 脚本创建 Nuget 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Visual Studio 2013 中创建包含 dacpac 和 Powershell 脚本的 Nuget 包?我是否会将这两个文件放在同一位置然后调用 nuget pack {folder name}?Powershell 脚本基本上将 dacpac 部署到 Octopus Deploy.我有碎片,但我不知道如何将它们组合在一起!

解决方案

您的 Powershell 脚本和 dacpac 是否在 Visual Studio 项目中?如果没有,您可能不需要在过程中包含 VS.

您可以使用 OctoPackNuGet 命令行工具.

无论哪种方式,您都需要先创建一个 nuspec 文件,然后才能运行 pack 命令.您可以按照文档中的格式手动创建一个,也可以使用 nuget spec 命令创建一个.获得 nuspec 文件后,您可以使用 nuget pack 创建 nupkg 文件.

如果文件必须在 Visual Studio 项目中,步骤几乎相同,但您可能需要做一些额外的工作才能将部署脚本放置在 Octopus 调用的正确位置.

这是最近发布的http://swoogan.blogspot.ca/2015/04/deploying-dacpacs-with-octopus-deploy.html

How do I create a Nuget package in Visual Studio 2013 that includes a dacpac and a Powershell script? Would I have the two files in the same location then call nuget pack {folder name}? The Powershell script essentially deploys the dacpac to Octopus Deploy. I have the pieces, but I'm not sure how to put them together!

解决方案

Are your Powershell script and dacpac in the Visual Studio project? If not, you may not need to include VS in the process.

You can use either OctoPack or the NuGet command line tool.

Either way, you will need to create a nuspec file before you can run the pack command. You can create one manually following the format in the docs or you can use the nuget spec command to create one. Once you have the nuspec file, you can use nuget pack to create the nupkg file.

If the files have to be in a Visual Studio project, the steps are pretty much the same, but you might have to do a little extra work to get the deploy script in the correct spot for Octopus to call it.

Edit: This was posted recently http://swoogan.blogspot.ca/2015/04/deploying-dacpacs-with-octopus-deploy.html

这篇关于为 Dacpac 和 Powershell 脚本创建 Nuget 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆