Skip to content

Commit 094e8d4

Browse files
authored
Merge pull request #59 from sqlcollaborative/development
v0.5
2 parents f1c1d69 + 3471d54 commit 094e8d4

File tree

157 files changed

+9386
-3363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+9386
-3363
lines changed

appveyor.yml

Lines changed: 62 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,77 @@
33
build: false
44
version: 0.1.{build}
55

6+
#images
7+
8+
image:
9+
- Ubuntu1804
10+
- Visual Studio 2017
11+
612
# Set build info
713
environment:
814
environment: development
915
version: 0.1.$(appveyor_build_number)
10-
16+
PGUSER: postgres
17+
PGPASSWORD: Password12!
18+
1119
matrix:
12-
# - scenario: MSSQL
13-
# main_instance: localhost\SQL2017
14-
# services:
15-
# - mssql2017
16-
- scenario: ALL
17-
# main_instance: localhost\SQL2017
18-
19-
#Configure services
20-
services:
21-
- mssql2017
22-
23-
# Set alternative clone folder
24-
clone_folder: c:\github\dbops
20+
- scenario: all
21+
# - scenario: mysql
2522

26-
before_test:
27-
# run preparation scripts
28-
- ps: .\Tests\appveyor.prep.ps1
29-
30-
test_script:
31-
# Test with native PS version
32-
- ps: .\Tests\appveyor.pester.ps1
3323

34-
# Collecting results
35-
- ps: .\Tests\appveyor.pester.ps1 -Finalize
24+
for:
25+
- matrix:
26+
only:
27+
- image: Visual Studio 2017
28+
#scenario: all
29+
environment:
30+
mssql_instance: localhost\SQL2017
31+
scenario: windows
32+
services:
33+
- mssql2017
34+
- mysql
35+
- postgresql
36+
before_test:
37+
- SET PATH=C:\Program Files\PostgreSQL\9.6\bin\;%PATH%
38+
- psql -c "CREATE USER sa WITH PASSWORD 'Password12!';" -U postgres
39+
- psql -c "ALTER USER sa WITH SUPERUSER;" -U postgres
40+
- ps: .\tests\appveyor.prep.ps1
41+
42+
- matrix:
43+
only:
44+
- image: Ubuntu1804
45+
scenario: all
46+
environment:
47+
mssql_instance: localhost
48+
services:
49+
- mssql
50+
- mysql
51+
- postgresql
52+
before_test:
53+
- sudo -u postgres psql -c "CREATE USER sa WITH PASSWORD 'Password12!';"
54+
- sudo -u postgres psql -c "ALTER USER sa WITH SUPERUSER;"
55+
- ps: .\tests\appveyor.prep.ps1
56+
- docker run --name dbops-oracle -d -p 1521:1521 -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g
57+
58+
# before_test:
59+
# # run preparation scripts
60+
# - ps: .\tests\appveyor.prep.ps1
61+
# # create postres user
3662

63+
64+
test_script:
65+
# Test with native PS version
66+
- ps: .\tests\appveyor.pester.ps1
67+
# Collecting results
68+
- ps: .\tests\appveyor.pester.ps1 -Finalize
3769
after_test:
38-
- ps: .\Tests\appveyor.post.ps1
70+
- ps: .\tests\appveyor.post.ps1
71+
72+
73+
# Set alternative clone folder
74+
#clone_folder: c:\github\dbops
75+
76+
3977

4078
#on_finish:
4179
# - ps:

bin/dbup-core.dll

-70.5 KB
Binary file not shown.

bin/dbup-oracle.dll

-13.5 KB
Binary file not shown.

bin/dbup-sqlserver.dll

-17 KB
Binary file not shown.

bin/deploy.ps1

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
[CmdletBinding(SupportsShouldProcess = $true)]
1+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "")]
2+
[CmdletBinding(SupportsShouldProcess)]
23
Param (
34
[Alias('Server', 'SqlServer', 'DBServer', 'Instance')]
45
[string]$SqlInstance,
@@ -20,13 +21,14 @@ Param (
2021
[switch]$Append,
2122
[Alias('Config')]
2223
[object]$Configuration,
24+
[string[]]$Build,
2325
[string]$Schema,
2426
[switch]$CreateDatabase,
2527
[AllowNull()]
2628
[string]$ConnectionString,
27-
[ValidateSet('SQLServer', 'Oracle')]
28-
[Alias('Type', 'ServerType')]
29-
[string]$ConnectionType = 'SQLServer'
29+
[ValidateSet('SqlServer', 'Oracle', 'MySQL', 'PostgreSQL')]
30+
[Alias('ConnectionType', 'ServerType')]
31+
[string]$Type = 'SQLServer'
3032
)
3133

3234
#Import module
@@ -37,22 +39,23 @@ If (-not (Get-Module dbops)) {
3739

3840
$config = Get-DBOConfig -Path "$PSScriptRoot\dbops.config.json" -Configuration $Configuration
3941

40-
#Convert custom parameters into a package configuration, excluding variables
42+
#Merge custom parameters into a configuration
43+
$newConfig = @{}
4144
foreach ($key in ($PSBoundParameters.Keys)) {
42-
if ($key -in [DBOpsConfigProperty].GetEnumNames() -and $key -ne 'Variables') {
43-
Write-PSFMessage -Level Debug -Message "Overriding parameter $key with $($PSBoundParameters[$key])"
44-
$config.SetValue($key, $PSBoundParameters[$key])
45+
if ($key -in [DBOpsConfig]::EnumProperties()) {
46+
$newConfig.$key = $PSBoundParameters[$key]
4547
}
4648
}
49+
$config.Merge($newConfig)
4750

4851
#Prepare deployment function call parameters
4952
$params = @{
50-
PackageFile = "$PSScriptRoot\dbops.package.json"
53+
PackageFile = "$PSScriptRoot\dbops.package.json"
5154
Configuration = $config
5255
}
5356
foreach ($key in ($PSBoundParameters.Keys)) {
5457
#If any custom properties were specified
55-
if ($key -in @('OutputFile', 'Append', 'Variables', 'ConnectionType')) {
58+
if ($key -in @('OutputFile', 'Append', 'Type', 'Build')) {
5659
$params += @{ $key = $PSBoundParameters[$key] }
5760
}
5861
}

bin/lib/net35/dbup-sqlserver.dll

17.5 KB
Binary file not shown.

bin/lib/net45/dbup-core.dll

114 KB
Binary file not shown.

bin/lib/net45/dbup-mysql.dll

12.5 KB
Binary file not shown.

bin/lib/net45/dbup-oracle.dll

13.5 KB
Binary file not shown.

bin/lib/net45/dbup-postgresql.dll

13 KB
Binary file not shown.

0 commit comments

Comments
 (0)