MATIH Platform is in active MVP development. Documentation reflects current implementation status.
18. CI/CD & Build System
Stage 01: Build Setup

Stage 01: Build Setup

Stage 01 prepares the build environment by configuring Docker buildx for multi-architecture builds and validating schemas. It depends on Stage 00 (Terraform) for ACR credentials.

Source files: scripts/stages/01-build-setup.sh, scripts/stages/01a-validate-schemas.sh


Sub-Stages

01: Build Setup

Configures the Docker buildx builder for multi-architecture (amd64/arm64) image builds:

# Create or reuse buildx builder
docker buildx inspect matih-builder &>/dev/null || \
    docker buildx create --name matih-builder --use
 
# Configure ACR authentication
az acr login --name ${ACR_NAME}

01a: Schema Validation

Validates database schemas against Hibernate entity definitions:

# Full validation runs Hibernate schema export in a container
# Compares exported schema against Flyway migration files
FULL_SCHEMA_VALIDATION=true  # Requires Docker

When FULL_SCHEMA_VALIDATION=true, this stage:

  1. Starts a temporary PostgreSQL container
  2. Runs Flyway migrations to create the schema
  3. Exports Hibernate's expected schema
  4. Diffs actual vs expected and reports discrepancies

Dependencies

StageRequired By
00-terraformProvides ACR credentials for Docker login

Dependency Check

The pipeline verifies this stage by checking for the Docker buildx builder:

docker buildx inspect matih-builder &>/dev/null && return 0

Environment Variables

VariableDefaultDescription
FULL_SCHEMA_VALIDATIONtrueRun full Hibernate schema validation
SKIP_SCHEMA_VALIDATIONfalseSkip schema validation entirely
ACR_NAMEmatihacrAzure Container Registry name