-
Notifications
You must be signed in to change notification settings - Fork 5
/
SSDT DacPac Command.ps1
26 lines (22 loc) · 1.67 KB
/
SSDT DacPac Command.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Get the supplied parameters
$DACPACPackageStep = $OctopusParameters["DACPACPackageStep"]
$DACPACPackageName = $OctopusParameters["DACPACPackageName"]
$PublishProfile = $OctopusParameters["DACPACPublishProfile"]
$Report = Format-OctopusArgument -Value $OctopusParameters["Report"]
$Script = Format-OctopusArgument -Value $OctopusParameters["Script"]
$Deploy = Format-OctopusArgument -Value $OctopusParameters["Deploy"]
$TargetServer = $OctopusParameters["TargetServer"]
$TargetDatabase = $OctopusParameters["TargetDatabase"]
$UseIntegratedSecurity = Format-OctopusArgument -Value $OctopusParameters["UseIntegratedSecurity"]
$Username = $OctopusParameters["SQLUsername"]
$Password = $OctopusParameters["SQLPassword"]
$AdditionalDeploymentContributors = $OctopusParameters["AdditionalContributors"]
$AdditionalDeploymentContributorArguments = $OctopusParameters["AdditionalContributorArguments"]
$InstallPathKey = ("Octopus.Action[{0}].Output.Package.InstallationDirectoryPath" -f $DACPACPackageStep)
$InstallPath = $OctopusParameters[$InstallPathKey]
# Expand the publish dacpac filename
$DACPACPackageName = ($InstallPath + "\" + $DACPACPackageName)
# Expand the publish profile filename
$PublishProfile = ($InstallPath + "\" + $PublishProfile)
# Invoke the DacPac utility
Invoke-DacPacUtility -Report $Report -Script $Script -Deploy $Deploy -DacPacFilename $DACPACPackageName -TargetServer $TargetServer -TargetDatabase $TargetDatabase -UseIntegratedSecurity $UseIntegratedSecurity -Username $Username -Password $Password -PublishProfile $PublishProfile -AdditionalDeploymentContributors $AdditionalDeploymentContributors -AdditionalDeploymentContributorArguments $AdditionalDeploymentContributorArguments