Skip to main content

Database Build & Deploy Pipeline

Build Status

View pipeline in Azure DevOps

Purpose

  • Builds the S0PMOBAI.sqlproj DACPAC via a reusable database deployment template.
  • Promotes the packaged DACPAC through Dev -> Test -> Stage -> Prod with gated approvals and secrets per environment.

Resources

  • Imports templates/db/database-deployment.yml from S0AIDXXX-AI Delivery/s0aidxxx-templates (tag v1.0.4).
  • Uses Azure DevOps variable groups for environment-specific SQL passwords.

Triggers

  • Branches: main, any releases/* branch.
  • Paths: src/db/*.
  • Lower environments skip on release branches with not(startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/')).

Agent Pool

  • Runs on ubuntu-latest-publix.

Stage Overview

  • Single template-driven stage with parameters:
    • buildPath: **/S0PMOBAI.sqlproj.
    • artifactName: S0PMOBAI.
    • buildConfiguration: Release.
    • environmentObjects: defines release order, approvals, and SQL connection metadata.
  • The template compiles the SQL project, publishes the DACPAC artifact, and deploys to each environment.

Environment Matrix

EnvService ConnectionADO EnvironmentConditionSQL ServerDatabaseAuto Approve
Devs0pmobai-01-devDEV_S0PMOBAISkipped on releases/* branchescutdasqlpmobchat01cutdsqdbpmobchat01Yes
Tsts0pmobai-01-tstDEV_S0PMOBAISkipped on releases/* branchescuttasqlpmobchat01cuttsqdbpmobchat01Yes
Stgs0pmobai-01-stgDEV_S0PMOBAISkipped on releases/* branchescutsasqlpmobchat01cutssqdbpmobchat01No
Prds0pmobai-01-prdPRD_S0PMOBAIAlways activecutpasqlpmobchat01cutpsqdbpmobchat01No

Release Branch Behavior

  • Dev/Test/Stage environments are guarded by the release-branch condition, preventing redeployments from releases/*.
  • Production remains active so release branches can deploy after validation.

Maintenance Notes

  • Update template tags deliberately; new versions may add or change required inputs.
  • Maintain SQL usernames, passwords, and service connections to match Azure DevOps environments.
  • Validate schema changes locally with dotnet build src/db/S0PMOBAI/S0PMOBAI.sqlproj before pushing updates.