MATIH Platform is in active MVP development. Documentation reflects current implementation status.
18. CI/CD & Build System
Tooling
Service Build & Deploy

Service Build and Deploy

The service-build-deploy.sh script provides deterministic, reproducible builds for individual services. It clones fresh source code, builds Docker images without caching, pushes to ACR, and deploys via Helm.

Source: scripts/tools/service-build-deploy.sh


Usage

./scripts/tools/service-build-deploy.sh <service-name> [options]

Options

OptionDescription
--rebuild-baseForce rebuild of base images even if unchanged
--skip-baseSkip automatic base image rebuild (use existing)
--skip-deployOnly build, do not deploy to Kubernetes
--namespace <ns>Override deployment namespace
--wait-timeout <s>Seconds to wait for pod health (default: 300)
--dry-runShow what would be done without executing

Examples

# Build and deploy tenant-service
./scripts/tools/service-build-deploy.sh tenant-service
 
# Rebuild with fresh base images
./scripts/tools/service-build-deploy.sh tenant-service --rebuild-base
 
# Build only (no deployment)
./scripts/tools/service-build-deploy.sh ai-service --skip-deploy

Build Guarantees

GuaranteeImplementation
Fresh source codeForces fresh git clone
No Docker cacheBuilds without layer caching
Source verificationVerifies source code after clone
Clear errorsDescriptive error messages on failure

Execution Flow

1. Parse arguments
2. Resolve service type (Java, Python, Node.js)
3. Resolve namespace from components.yaml
4. Clone fresh source code
5. Build base images (if needed)
6. Build service Docker image
7. Push to ACR
8. Deploy via Helm
9. Wait for pod health
10. Report status

ACR Configuration

SettingSourceDefault
ACR_NAMETerraform outputsmatihlabsacr
ACR_URLTerraform outputsmatihlabsacr.azurecr.io
GIT_BRANCHEnvironmentmain
BUILD_NAMESPACEHardcodedmatih-build

Libraries Used

LibraryPurpose
core/config.shService registry and Terraform outputs

Related Pages