iec-builder
v0.1.0
Published
CI/CD Build Service for InsurEco Tawa platform
Readme
iec-builder
CI/CD Build Service for InsurEco Tawa platform.
Overview
iec-builder receives webhooks from Git providers (GitHub, GitLab, Bitbucket), builds Docker images, and deploys to Kubernetes. It runs on the tawa-builder server (64.23.181.20) alongside Docker.
Architecture
Developer's Repo → Webhook → iec-builder → Docker Build → registry.insureco.io → K8s DeployAPI Endpoints
Webhooks
POST /webhooks/github- GitHub push webhookPOST /webhooks/gitlab- GitLab push webhookPOST /webhooks/generic- Generic webhook
Services (registered apps)
GET /services- List registered servicesPOST /services- Register a new serviceGET /services/:id- Get service detailsPATCH /services/:id- Update service configDELETE /services/:id- Unregister serviceGET /services/:id/builds- Get builds for service
Builds
GET /builds- List buildsGET /builds/:id- Get build detailsGET /builds/:id/logs- Get build logsPOST /builds/trigger- Manually trigger buildPOST /builds/:id/cancel- Cancel a buildPOST /builds/:id/retry- Retry a failed build
Development
npm install
npm run devDeployment (tawa-builder)
# SSH into tawa-builder
ssh tawa
# Deploy updates
cd /opt/iec-builder
git pull origin main
npm install
npm run build
pm2 restart iec-builder
pm2 saveServer Details
- Host: 64.23.181.20 (ssh alias:
tawa) - User: tawa
- SSH Key: ~/.ssh/do_2025
- App Path: /opt/iec-builder
- PM2 ID: 0
Quick Deploy Command
ssh tawa "cd /opt/iec-builder && git pull && npm install && npm run build && pm2 restart iec-builder"Environment Variables
| Variable | Default | Description | |----------|---------|-------------| | PORT | 3002 | HTTP port | | MONGODB_URI | mongodb://localhost:27017/builder | MongoDB connection | | REDIS_URL | redis://localhost:6379 | Redis connection | | KOKO_URL | http://koko... | Koko service URL | | WORKSPACE_DIR | /tmp/iec-builds | Build workspace | | DOCKER_REGISTRY | registry.insureco.io/insureco | Container registry | | DOCKER_REGISTRY_USER | | Registry username (Forgejo user) | | DOCKER_REGISTRY_TOKEN | | Registry password (Forgejo access token) | | K8S_NAMESPACE | iec-platform | Kubernetes namespace |
