cake-contrib/Cake.SqlPackage

Plain Text deployment report.

Closed this issue · 2 comments

I am wondering if there is a way to generate plain text deployment report like the one Visual Studio generates.

I am currently using VS2017. I have a simple database project with only one sample table. When I publish/generate script my database from visual studio I get a "DeploymentReport.txt" file in ./bin/Debug which looks like this.

** Highlights
     Tables that will be rebuilt
       None
     Clustered indexes that will be dropped
       None
     Clustered indexes that will be created
       None
     Possible data issues
       None

** User actions
     Create
       [dbo].[SampleTable] (Table)

** Supporting actions

I cannot seem to find a way to generate this plain text Deployment Report. When I create following task in my .cake script, I only get xml content.

Task("DeploymentReport")
    .IsDependentOn("Build")
    .Does(() =>
    {
        EnsureDirectoryExists("./scripts");

        SqlPackageDeployReport(settings => 
        {
            settings.SourceFile = dacpac;
            settings.Profile = publishProfile;
            settings.OutputPath = File("./scripts/DeploymentReport.txt");
        }); 
    });

output looks like this

<?xml version="1.0" encoding="utf-8"?>
<DeploymentReport xmlns="http://schemas.microsoft.com/sqlserver/dac/DeployReport/2012/02">
<Alerts />
<Operations>
	<Operation Name="Create">
		<Item Value="[dbo].[SampleTable]" Type="SqlTable" />
	</Operation>
</Operations>
</DeploymentReport>

Is this possible using Cake.SqlPackage? or may be this is not part of sqlpackage.exe as I can see the documentation only says it generates xml report. If so any idea how this can be achieved?

@sunilshahi25 Unfortunately, Cake.SqlPackage is a wrapper around sqlpackage.exe that makes it easily consumable in the Cake DSL. If it isn't supported in the core library, there isn't support for it here. Can you intercept the command that VS2107 is running to get that output? I'd be interested in at least knowing how VS2017 is generating that report.

Not sure how I can intercept the command. Looks like this is not a part of sqlpackage.exe. There is no mention of this in documentation. Please close this issue if you like.