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
| Option | Description |
|---|---|
--rebuild-base | Force rebuild of base images even if unchanged |
--skip-base | Skip automatic base image rebuild (use existing) |
--skip-deploy | Only build, do not deploy to Kubernetes |
--namespace <ns> | Override deployment namespace |
--wait-timeout <s> | Seconds to wait for pod health (default: 300) |
--dry-run | Show 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-deployBuild Guarantees
| Guarantee | Implementation |
|---|---|
| Fresh source code | Forces fresh git clone |
| No Docker cache | Builds without layer caching |
| Source verification | Verifies source code after clone |
| Clear errors | Descriptive 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 statusACR Configuration
| Setting | Source | Default |
|---|---|---|
ACR_NAME | Terraform outputs | matihlabsacr |
ACR_URL | Terraform outputs | matihlabsacr.azurecr.io |
GIT_BRANCH | Environment | main |
BUILD_NAMESPACE | Hardcoded | matih-build |
Libraries Used
| Library | Purpose |
|---|---|
core/config.sh | Service registry and Terraform outputs |
Related Pages
- Build System -- Full build pipeline
- CD Pipeline -- Automated deployment
- Platform Status -- Post-deploy diagnostics