Skip to content

Commit ed8f32d

Browse files
committed
renaming Invoke-DBODeployment
1 parent 4ca3e2f commit ed8f32d

9 files changed

+32
-32
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Install-Module dbops
6060

6161
Perform plain-text script deployments using a single command:
6262

63-
[![Invoke-DBODeployment](https://img.youtube.com/vi/PdMCk0Wa-FA/0.jpg)](http://www.youtube.com/watch?v=PdMCk0Wa-FA)<br/>
63+
[![Install-DBOScript](https://img.youtube.com/vi/PdMCk0Wa-FA/0.jpg)](http://www.youtube.com/watch?v=PdMCk0Wa-FA)<br/>
6464
<small>(click to open the video)</small>
6565

6666
Example code:

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Install-Module dbops
5555

5656
Perform plain-text script deployments using a single command:
5757

58-
[![Invoke-DBODeployment](https://img.youtube.com/vi/PdMCk0Wa-FA/0.jpg)](http://www.youtube.com/watch?v=PdMCk0Wa-FA)<br/>
58+
[![Install-DBOScript](https://img.youtube.com/vi/PdMCk0Wa-FA/0.jpg)](http://www.youtube.com/watch?v=PdMCk0Wa-FA)<br/>
5959
<small>(click to open the video)</small>
6060

6161
Example code:

functions/Install-DBOPackage.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
}
213213
}
214214
Write-PSFMessage -Level Verbose -Message "Preparing to start the deployment of package $($package.FileName)"
215-
Invoke-DBODeployment @params
215+
Invoke-Deployment @params
216216
}
217217
end {
218218

functions/Install-DBOScript.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
}
231231
}
232232
Write-PSFMessage -Level Verbose -Message "Preparing to start the deployment of $($Path.Count) file(s)"
233-
Invoke-DBODeployment @params
233+
Invoke-Deployment @params
234234

235235
# Test name deprecation
236236
Test-AliasDeprecation -DeprecatedOn "1.0.0" -EnableException:$false -Alias Install-DBOSqlScript

functions/Register-DBOPackage.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ function Register-DBOPackage {
199199
}
200200
}
201201
Write-PSFMessage -Level Verbose -Message "Preparing to register the package $($package.FileName)"
202-
Invoke-DBODeployment @params
202+
Invoke-Deployment @params
203203
}
204204
end {
205205

internal/functions/Invoke-DBODeployment.ps1 internal/functions/Invoke-Deployment.ps1

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function Invoke-DBODeployment {
1+
function Invoke-Deployment {
22
<#
33
.SYNOPSIS
44
Deploys extracted dbops package from the specified location
@@ -52,19 +52,19 @@
5252
5353
.EXAMPLE
5454
# Start the deployment of the extracted package from the current folder
55-
Invoke-DBODeployment
55+
Invoke-Deployment
5656
5757
.EXAMPLE
5858
# Start the deployment of the extracted package from the current folder using specific connection parameters
59-
Invoke-DBODeployment -SqlInstance 'myserver\instance1' -Database 'MyDb' -ExecutionTimeout 3600
59+
Invoke-Deployment -SqlInstance 'myserver\instance1' -Database 'MyDb' -ExecutionTimeout 3600
6060
6161
.EXAMPLE
6262
# Start the deployment of the extracted package using custom logging parameters and schema tracking table
63-
Invoke-DBODeployment .\Extracted\dbops.package.json -SchemaVersionTable dbo.SchemaHistory -OutputFile .\out.log -Append
63+
Invoke-Deployment .\Extracted\dbops.package.json -SchemaVersionTable dbo.SchemaHistory -OutputFile .\out.log -Append
6464
6565
.EXAMPLE
6666
# Start the deployment of the extracted package in the current folder using variables instead of specifying values directly
67-
Invoke-DBODeployment -SqlInstance '#{server}' -Database '#{db}' -Configuration @{ Variables = @{server = 'myserver\instance1'; db = 'MyDb'} }
67+
Invoke-Deployment -SqlInstance '#{server}' -Database '#{db}' -Configuration @{ Variables = @{server = 'myserver\instance1'; db = 'MyDb'} }
6868
#>
6969

7070
[CmdletBinding(SupportsShouldProcess, DefaultParameterSetName = 'PackageFile')]

internal/json/dbops.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"internal\\functions\\Get-DbUpJournal.ps1",
7575
"internal\\functions\\Invoke-EnsureDatabase.ps1",
7676
"internal\\functions\\Get-DatabaseConnection.ps1",
77-
"internal\\functions\\Invoke-DBODeployment.ps1",
77+
"internal\\functions\\Invoke-Deployment.ps1",
7878
"internal\\functions\\Install-NugetPackage.ps1",
7979
"internal\\functions\\Test-AliasDeprecation.ps1",
8080
"internal\\classes\\DBOpsHelper.class.ps1",

tests/Invoke-DBODeployment.Tests.ps1

+20-20
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $newDbName = "_test_$commandName"
3434
$dropDatabaseScript = 'IF EXISTS (SELECT * FROM sys.databases WHERE name = ''{0}'') BEGIN ALTER DATABASE [{0}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; DROP DATABASE [{0}]; END' -f $newDbName
3535
$createDatabaseScript = 'IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = ''{0}'') BEGIN CREATE DATABASE [{0}]; END' -f $newDbName
3636

37-
Describe "Invoke-DBODeployment integration tests" -Tag $commandName, IntegrationTests {
37+
Describe "Invoke-Deployment integration tests" -Tag $commandName, IntegrationTests {
3838
BeforeAll {
3939
if ((Test-Path $workFolder) -and $workFolder -like '*.Tests.dbops') { Remove-Item $workFolder -Recurse }
4040
$null = New-Item $workFolder -ItemType Directory -Force
@@ -66,7 +66,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
6666
#Running package
6767
$deploymentConfig.DeploymentMethod = 'SingleTransaction'
6868
try {
69-
$null = Invoke-DBODeployment -PackageFile $packageFileName -Configuration $deploymentConfig
69+
$null = Invoke-Deployment -PackageFile $packageFileName -Configuration $deploymentConfig
7070
}
7171
catch {
7272
$testResults = $_
@@ -88,7 +88,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
8888
It "Should throw an error and create one object" {
8989
#Running package
9090
try {
91-
$null = Invoke-DBODeployment -PackageFile $packageFileName -Configuration $deploymentConfig
91+
$null = Invoke-Deployment -PackageFile $packageFileName -Configuration $deploymentConfig
9292
}
9393
catch {
9494
$testResults = $_
@@ -108,7 +108,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
108108
$null = Invoke-DBOQuery -SqlInstance $script:mssqlInstance -Silent -Credential $script:mssqlCredential -Database $newDbName -InputFile $cleanupScript
109109
}
110110
It "should deploy version 1.0" {
111-
$testResults = Invoke-DBODeployment -ScriptFile $v1files -Configuration $deploymentConfig
111+
$testResults = Invoke-Deployment -ScriptFile $v1files -Configuration $deploymentConfig
112112
$testResults.Successful | Should Be $true
113113
$testResults.Scripts.Name | Should Be (Resolve-Path $v1scripts).Path
114114
$testResults.SqlInstance | Should Be $script:mssqlInstance
@@ -132,7 +132,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
132132
'd' | Should Not BeIn $testResults.name
133133
}
134134
It "should deploy version 2.0" {
135-
$testResults = Invoke-DBODeployment -ScriptFile $v2files -Configuration $deploymentConfig
135+
$testResults = Invoke-Deployment -ScriptFile $v2files -Configuration $deploymentConfig
136136
$testResults.Successful | Should Be $true
137137
$testResults.Scripts.Name | Should Be (Resolve-Path $v2scripts).Path
138138
$testResults.SqlInstance | Should Be $script:mssqlInstance
@@ -161,7 +161,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
161161
$null = Invoke-DBOQuery -SqlInstance $script:mssqlInstance -Silent -Credential $script:mssqlCredential -Database $newDbName -InputFile $cleanupScript
162162
}
163163
It "should deploy 2.sql before 1.sql" {
164-
$testResults = Invoke-DBODeployment -ScriptFile $v2files, $v1files -Configuration $deploymentConfig
164+
$testResults = Invoke-Deployment -ScriptFile $v2files, $v1files -Configuration $deploymentConfig
165165
$testResults.Successful | Should Be $true
166166
$testResults.Scripts.Name | Should Be (Resolve-Path $v2scripts, $v1scripts).Path
167167
$testResults.SqlInstance | Should Be $script:mssqlInstance
@@ -200,7 +200,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
200200
It "should throw timeout error" {
201201
$deploymentConfig.ExecutionTimeout = 2
202202
try {
203-
$null = Invoke-DBODeployment -ScriptFile $delayScripts -Configuration $deploymentConfig -OutputFile "$workFolder\log.txt"
203+
$null = Invoke-Deployment -ScriptFile $delayScripts -Configuration $deploymentConfig -OutputFile "$workFolder\log.txt"
204204
}
205205
catch {
206206
$testResults = $_
@@ -213,7 +213,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
213213
}
214214
It "should successfully run within specified timeout" {
215215
$deploymentConfig.ExecutionTimeout = 6
216-
$testResults = Invoke-DBODeployment -ScriptFile $delayScripts -Configuration $deploymentConfig -OutputFile "$workFolder\log.txt"
216+
$testResults = Invoke-Deployment -ScriptFile $delayScripts -Configuration $deploymentConfig -OutputFile "$workFolder\log.txt"
217217
$testResults.Successful | Should Be $true
218218
$testResults.Scripts.Name | Should Be (Join-PSFPath -Normalize "$workFolder\delay.sql")
219219
$testResults.SqlInstance | Should Be $script:mssqlInstance
@@ -233,7 +233,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
233233
}
234234
It "should successfully run with infinite timeout" {
235235
$deploymentConfig.ExecutionTimeout = 0
236-
$testResults = Invoke-DBODeployment -ScriptFile $delayScripts -Configuration $deploymentConfig -OutputFile "$workFolder\log.txt"
236+
$testResults = Invoke-Deployment -ScriptFile $delayScripts -Configuration $deploymentConfig -OutputFile "$workFolder\log.txt"
237237
$testResults.Successful | Should Be $true
238238
$testResults.Scripts.Name | Should Be (Join-PSFPath -Normalize "$workFolder\delay.sql")
239239
$testResults.SqlInstance | Should Be $script:mssqlInstance
@@ -260,7 +260,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
260260
AfterAll {
261261
}
262262
It "should deploy nothing" {
263-
$testResults = Invoke-DBODeployment -ScriptFile $v1files -Configuration $deploymentConfig -WhatIf
263+
$testResults = Invoke-Deployment -ScriptFile $v1files -Configuration $deploymentConfig -WhatIf
264264
$testResults.Successful | Should Be $true
265265
$testResults.Scripts.Name | Should Be $v1scripts
266266
$testResults.SqlInstance | Should Be $script:mssqlInstance
@@ -296,7 +296,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
296296
$deploymentConfig.Remove('SchemaVersionTable')
297297
$before = Invoke-DBOQuery -SqlInstance $script:mssqlInstance -Silent -Credential $script:mssqlCredential -Database $newDbName -InputFile $verificationScript
298298
$rowsBefore = ($before | Measure-Object).Count
299-
$testResults = Invoke-DBODeployment -ScriptFile $v1files -Configuration $deploymentConfig
299+
$testResults = Invoke-Deployment -ScriptFile $v1files -Configuration $deploymentConfig
300300
$testResults.Successful | Should Be $true
301301
$testResults.Scripts.Name | Should Be (Resolve-Path $v1scripts).Path
302302
$testResults.SqlInstance | Should Be $script:mssqlInstance
@@ -324,7 +324,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
324324
$deploymentConfig.Remove('SchemaVersionTable')
325325
$before = Invoke-DBOQuery -SqlInstance $script:mssqlInstance -Silent -Credential $script:mssqlCredential -Database $newDbName -InputFile $verificationScript
326326
$rowsBefore = ($before | Measure-Object).Count
327-
$testResults = Invoke-DBODeployment -ScriptFile $v2files -Configuration $deploymentConfig
327+
$testResults = Invoke-Deployment -ScriptFile $v2files -Configuration $deploymentConfig
328328
$testResults.Successful | Should Be $true
329329
$testResults.Scripts.Name | Should Be (Resolve-Path $v2scripts).Path
330330
$testResults.SqlInstance | Should Be $script:mssqlInstance
@@ -360,7 +360,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
360360
$deploymentConfig.SchemaVersionTable = $null
361361
$before = Invoke-DBOQuery -SqlInstance $script:mssqlInstance -Silent -Credential $script:mssqlCredential -Database $newDbName -InputFile $verificationScript
362362
$rowsBefore = ($before | Measure-Object).Count
363-
$testResults = Invoke-DBODeployment -ScriptFile $v1files -Configuration $deploymentConfig
363+
$testResults = Invoke-Deployment -ScriptFile $v1files -Configuration $deploymentConfig
364364
$testResults.Successful | Should Be $true
365365
$testResults.Scripts.Name | Should Be (Resolve-Path $v1scripts).Path
366366
$testResults.SqlInstance | Should Be $script:mssqlInstance
@@ -393,7 +393,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
393393
It "should register version 1.0 without creating any objects" {
394394
$before = Invoke-DBOQuery -SqlInstance $script:mssqlInstance -Silent -Credential $script:mssqlCredential -Database $newDbName -InputFile $verificationScript
395395
$rowsBefore = ($before | Measure-Object).Count
396-
$testResults = Invoke-DBODeployment -ScriptFile $v1files -Configuration $deploymentConfig -RegisterOnly
396+
$testResults = Invoke-Deployment -ScriptFile $v1files -Configuration $deploymentConfig -RegisterOnly
397397
$testResults.Successful | Should Be $true
398398
$testResults.Scripts.Name | Should Be (Resolve-Path $v1scripts).Path
399399
$testResults.SqlInstance | Should Be $script:mssqlInstance
@@ -424,7 +424,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
424424
It "should register version 1.0 + 2.0 without creating any objects" {
425425
$before = Invoke-DBOQuery -SqlInstance $script:mssqlInstance -Silent -Credential $script:mssqlCredential -Database $newDbName -InputFile $verificationScript
426426
$rowsBefore = ($before | Measure-Object).Count
427-
$testResults = Invoke-DBODeployment -ScriptFile $v1files, $v2files -Configuration $deploymentConfig -RegisterOnly
427+
$testResults = Invoke-Deployment -ScriptFile $v1files, $v2files -Configuration $deploymentConfig -RegisterOnly
428428
$testResults.Successful | Should Be $true
429429
$testResults.Scripts.Name | Should Be (Resolve-Path $v2scripts).Path
430430
$testResults.SqlInstance | Should Be $script:mssqlInstance
@@ -464,11 +464,11 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
464464
# Deploy a non-logged script
465465
$dc = $deploymentConfig.Clone()
466466
$dc.SchemaVersionTable = $null
467-
$null = Invoke-DBODeployment -ScriptFile $v1files -Configuration $dc
467+
$null = Invoke-Deployment -ScriptFile $v1files -Configuration $dc
468468
#Running package
469469
try {
470470
$testResults = $null
471-
$testResults = Invoke-DBODeployment -PackageFile $packageFileName -Configuration $deploymentConfig
471+
$testResults = Invoke-Deployment -PackageFile $packageFileName -Configuration $deploymentConfig
472472
}
473473
catch {
474474
$errorObject = $_
@@ -481,8 +481,8 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
481481
#Running package
482482
try {
483483
$testResults = $null
484-
$null = Invoke-DBODeployment -PackageFile $packageFileName -Configuration $deploymentConfig
485-
$testResults = Invoke-DBODeployment -ScriptFile $v2files -Configuration $deploymentConfig
484+
$null = Invoke-Deployment -PackageFile $packageFileName -Configuration $deploymentConfig
485+
$testResults = Invoke-Deployment -ScriptFile $v2files -Configuration $deploymentConfig
486486
}
487487
catch {
488488
$errorObject = $_
@@ -503,7 +503,7 @@ Describe "Invoke-DBODeployment integration tests" -Tag $commandName, Integration
503503
$null = Invoke-DBOQuery -SqlInstance $script:mssqlInstance -Silent -Credential $script:mssqlCredential -Database $newDbName -InputFile $cleanupScript
504504
}
505505
It "should throw if ScriptFile is not DBOpsFile" {
506-
{ Invoke-DBODeployment -ScriptFile $v1scripts -Configuration $deploymentConfig } | Should -Throw 'Expected DBOpsFile'
506+
{ Invoke-Deployment -ScriptFile $v1scripts -Configuration $deploymentConfig } | Should -Throw 'Expected DBOpsFile'
507507
}
508508
}
509509
}

tests/deploy.ps1.Tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Describe "deploy.ps1 integration tests" -Tag $commandName, IntegrationTests {
124124
$testResults.StartTime | Should -Not -BeNullOrEmpty
125125
$testResults.EndTime | Should -Not -BeNullOrEmpty
126126
$testResults.EndTime | Should -BeGreaterOrEqual $testResults.StartTime
127-
Get-ChildItem function:\ | Where-Object Name -eq Invoke-DBODeployment | Should -BeNullOrEmpty
127+
Get-ChildItem function:\ | Where-Object Name -eq Invoke-Deployment | Should -BeNullOrEmpty
128128
}
129129
$job = Start-Job -ScriptBlock $scriptBlock -ArgumentList $workFolder, "$here\constants.ps1", $newDbName
130130
$job | Wait-Job | Receive-Job -ErrorAction Stop

0 commit comments

Comments
 (0)