SSDT Output for Octopus

Hi,

We are using SSDT along with a structured Pre and Post deployment script section. We would like to know if we can use this output (schema diff and manual scripts) and form a compatible NuGet package for Octopus to deploy? This output is all orchestrated using Powershell. So we hope to extend that to create the required migration scripts for the NuGet package.

We are using latest version of SSDT in TFS 2013 along with VS 2013 for the development.

Thanks
Sean

Hi Sean,

Thanks for getting in touch! I responded to this message in our support system, but we have found on the rare occasion that the ticketing system we use can get caught in virus scanners.
If you did receive my message then I apologize for double touching as you may just be after a response from the community.

The following blog post has an example of packaging an SSDT project which hopefully you can use the examples to work with your setup.

Vanessa

The approach in the blog post is a bit naive in my opinion. It says because you can’t install Octopack you should just clutter your solution with a console app that consumes the SSDT.

There’s a better way. You can just create a custom target and add a few lines of code to create and push a nuget package to your nuget server or Octopus internal nuget server.

Furthermore (And I’ve said this a handful of times) Octopus support staff makes more work for themselves by not updating old documentation pages that point to these old blogs with newer relevant information. Heck I’d update them myself if you guys would put a system in place to accept and review contributions.

  <Target Name="AfterBuild" Condition="'$(Configuration)' == 'Release'">
    <ItemGroup>
      <TempPackages Include="$(MSBuildProjectDirectory)\*.nupkg" />
    </ItemGroup>
    <Delete Files="@(TempPackages)" />
    <Exec Command="C:\Tools\Nuget.exe pack $(MSBuildProjectDirectory)\DefendMailDb.nuspec" />
    <Exec Command="C:\Tools\Nuget.exe push &quot;$(MSBuildProjectDirectory)\*.nupkg&quot; API-KEY -s http://mywebsite/Octopus/nuget/packages" />
  </Target>

I’d be keen to see a fuller example if you have one, how do you get you SSDT project to call the AfterBuild target ?

SSDT uses MSBuild just like a web project. Simply unload it and edit the .sqlproj