Advertisement
Advertisement

More Related Content

Similar to BASTA! 2022 - Automatisiertes Datenbank-Deployment im DevOps-Prozess(20)

More from Marc Müller(20)

Advertisement

Recently uploaded(20)

BASTA! 2022 - Automatisiertes Datenbank-Deployment im DevOps-Prozess

  1. ▪ ▪ ▪ ▪ ▪
  2. Write Code Customer use the code Write Code Customer use the code
  3. 100 deployments per day!
  4. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪
  5. • • • • IDE MSBuild IntelliSense Validation Code Base Consistency Design Compare CI CD
  6. • • • DB Scheme Migrations (Static & Dynamic SQL) Single Pre- and Post Script Logic Microsoft.Data.Tools.Msbuild (NuGet)
  7. • •  •  • •
  8. • • • • •
  9. • • • • •
  10. Local DEV DB Visual Studio DB Project Git Repo → QA Dump Prod Dump
  11. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪
  12. ▪ ▪ ▪ ▪ ▪
  13. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪
  14. Start Deployment End Deployment GENERATE Deployment Script Run Script Pre-Deployment Script Run Script Post-Deployment Script Scheme Migration Deployment Script (DacPac) Database Deployment Build Process Run Script Reference Data Deployment Script
  15. ▪ ▪ ▪ ▪ ▪
  16. ▪ ▪ ▪ ▪ ▪ ▪ ▪
  17. • • • •
  18. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪
  19. Scenario Pre-Scripts SSDT Engine Reference Data Scripts Post-Scripts Add (not ) nullable field Supported Change to not nullable Value Migration (optional) Supported (Smart Defaults) Delete field Data Migration (optional) Supported Data Migration (optional) Change data type (float to dec) Data Migration (Custom Rounding) Supported Add stored procedure (SP) Supported Change SP Supported Delete objects Data Migration (optional) Supported (Enable Data Loss) Rename objects Supported Add user defined type (UDT) Supported Add business reference data Use merge scripts
  20. ▪ ▪ ▪ ▪ ▪ ▪ ▪
  21. • • •
  22. • • • •
  23. Build App Run Whitebox Tests Build SSDT DB Project Publish App Binaries Publish Dacpac
  24. Release v2 Deploy DB Schema Deploy Binaries Prod Environment v2 Binaries v1 Prod Environment v2 Binaries v2 Release v2 Deploy Binaries Deploy DB Schema Prod Environment v1 Binaries v1 Binaries v2 Factory Prod Environment v2 Binaries v1 Binaries v2 Factory
  25. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪
  26. ▪ ▪
  27. CD PR CI Checkout Build App Run Unit Test Build Dacpac Publish Dacpac Publish App Create DB Deploy DB Schema Deploy App QA Deploy DB Schema Deploy App Pre-Prod Clone Prod DB Deploy DB Schema Deploy App Prod Deploy DB Schema Deploy App CI Type
  28. steps: - pwsh: | /opt/sqlpackage/sqlpackage /a:Publish /p:BlockOnPossibleDataLoss= ${{ parameters.blockOnDataLoss }} /p:GenerateSmartDefaults=True /tcs:"${{ parameters.connection }} /sf:"${{ parameters.dacpacFile }}" displayName: 'Deploy DACPACs' https://docs.microsoft.com/de-de/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16
  29. ▪ ▪ ▪ ▪ ▪ ▪
  30. ▪ ▪ ▪ ▪ ▪ https://hub.docker.com/_/microsoft-mssql-server
  31. ▪ ▪ ▪
  32. ▪ ▪
  33. ▪ ▪ ▪ ▪
  34. ▪ ▪ ▪ ▪ ▪ ▪
  35. ▪ ▪ ▪ ▪
  36. Helm Release Deployment App Pod App Container Init Container Job DB Migration Pod DB Migration Container Service Ingress DB
  37. ▪ ▪ ▪ ▪
Advertisement