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 DockerWhen FULL_SCHEMA_VALIDATION=true, this stage:
- Starts a temporary PostgreSQL container
- Runs Flyway migrations to create the schema
- Exports Hibernate's expected schema
- Diffs actual vs expected and reports discrepancies
Dependencies
| Stage | Required By |
|---|---|
| 00-terraform | Provides 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 0Environment Variables
| Variable | Default | Description |
|---|---|---|
FULL_SCHEMA_VALIDATION | true | Run full Hibernate schema validation |
SKIP_SCHEMA_VALIDATION | false | Skip schema validation entirely |
ACR_NAME | matihacr | Azure Container Registry name |