This repository has been archived by the owner on Aug 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
appveyor.yml
87 lines (87 loc) · 3.92 KB
/
appveyor.yml
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
version: 0.1.{build}
image: Visual Studio 2017
install:
- ps: $env:SQL_SERVER_BACKUP_DIRECTORY=(Get-ItemProperty "HKLM:\Software\Microsoft\Microsoft SQL Server\MSSQL13.SQL2016\MSSqlServer").BackupDirectory
# The Visual Studio 2015 Imge doesn't have the newer version of New-SelfSignedCertificate with the paramaters I need to call.
# For now I'm restoring a password protected pfx. Yes this is an issue for secrets management, I'll addres in the near future.
- ps: Import-PfxCertificate -FilePath "$($env:SQL_SERVER_COLUMN_CERTIFICATE).pfx" -CertStoreLocation "Cert:\CurrentUser\My" -Password (ConvertTo-SecureString -String $env:PFX_PASSWORD -Force -AsPlainText) | Out-Null
assembly_info:
patch: true
file: 'GlobalAssemblyInfo.cs'
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}'
environment:
MSBUILD_LOG_VERSION: 2.0.94
MSBUILD_LOG_FILE: msbuild.binlog
NUGET_VERBOSITY: quiet
PFX_PASSWORD: # The decrypted value is 1234. I'm just doing this to demo secret management.
secure: 7/Xb2kAfb/4yKaHFokWjUA==
SQL_SERVER_INSTANCE: (local)\SQL2016
SQL_SERVER_USER: AlwaysEncryptedOwner
SQL_SERVER_PASSWORD: 7aO!z@xUu!4r6EvD#D&l$sz6&h^rhxL6fzAHMpnOga@LO*WdsEdpfh4^Egtl
SQL_SERVER_DATABASE: AlwaysEncryptedSample
SQL_SERVER_BACKUP_FILE: $(SQL_SERVER_DATABASE).bak
SQL_SERVER_DACPAC: $(SQL_SERVER_DATABASE).dacpac
SQL_SERVER_GENERATED_SCHEMA: $(SQL_SERVER_DATABASE).sql
SQL_SERVER_CONNECTION_STRING: "Data Source=$(SQL_SERVER_INSTANCE);Initial Catalog=$(SQL_SERVER_DATABASE);Integrated Security=SSPI;Application Name=AppVeyor CI Process;Column Encryption Setting=Enabled"
SQL_SERVER_VERIFICATION_LOG: $(SQL_SERVER_DATABASE).verification.log
SQL_SERVER_COLUMN_CERTIFICATE: AlwaysEncryptedSampleCMK
matrix:
- {}
services:
- mssql2016
nuget:
# This might be causing a hang.
# account_feed: true
project_feed: true
cache:
- packages -> **\packages.config
before_build:
- cmd: sqlcmd -S "%SQL_SERVER_INSTANCE%" -i .\appveyor\init.sql
# See here regarding -AboutClobber https://dba.stackexchange.com/a/174717/1817
- ps: Install-Module sqlserver -Scope CurrentUser -AllowClobber
- ps: .\New-EncryptionKeys.ps1 -ConnectionString $env:SQL_SERVER_CONNECTION_STRING -ExportCertificate
- ps: .\Invoke-EncryptColumns.ps1 -ConnectionString $env:SQL_SERVER_CONNECTION_STRING
- cmd: nuget restore -Verbosity %NUGET_VERBOSITY%
- cmd: nuget install MSBuild.StructuredLogger -Version %MSBUILD_LOG_VERSION% -SolutionDirectory . -Verbosity %NUGET_VERBOSITY%
build:
publish_nuget: true
publish_nuget_symbols: true
include_nuget_references: true
publish_wap: true
parallel: true
verbosity: minimal
after_build:
- ps: .\appveyor\Start-EntityFrameworkMigration.ps1
- cmd: sqlcmd -S "%SQL_SERVER_INSTANCE%" -d %SQL_SERVER_DATABASE% -W -i .\appveyor\schema_verification.sql -o %SQL_SERVER_VERIFICATION_LOG%
- cmd: sqlcmd -S "%SQL_SERVER_INSTANCE%" -Q "BACKUP DATABASE [$(SQL_SERVER_DATABASE)] TO DISK='$(SQL_SERVER_BACKUP_FILE)' WITH FORMAT, COMPRESSION, STATS=10;"
- ps: Move-Item -Path (Join-Path $env:SQL_SERVER_BACKUP_DIRECTORY "$($env:SQL_SERVER_BACKUP_FILE)") -Destination $env:APPVEYOR_BUILD_FOLDER
- cmd: sqlpackage.exe /Action:Extract /TargetFile:"%SQL_SERVER_DACPAC%" /SourceServerName:"%SQL_SERVER_INSTANCE%" /SourceDatabaseName:%SQL_SERVER_DATABASE%
- cmd: git status
artifacts:
- path: $(SQL_SERVER_BACKUP_FILE)
name: Database backup
type: file
- path: $(SQL_SERVER_DACPAC)
name: DACPAC
type: file
- path: $(SQL_SERVER_VERIFICATION_LOG)
name: Verifiction Query Results
type: file
- path: $(SQL_SERVER_COLUMN_CERTIFICATE).cer
name: Column Master Key Certificate
type: file
- path: $(MSBUILD_LOG_FILE)
name: MSBuild BInary Log
type: file
deploy:
- provider: NuGet
api_key:
secure: 0aWfYNiB1lufheXP4lU2Qc1Yewxv7cqea2VMUg1MZOOrppHYSNPpM2Nx4SKSYHCS
skip_symbols: false
artifact: /.*\.nupkg/
on:
branch: [
master
]