Files
cmdb-insight/scripts/build-and-push.sh
Bert Hausmans a7f8301196 Add database adapter system, production deployment configs, and new dashboard components
- Add PostgreSQL and SQLite database adapters with factory pattern
- Add migration script for SQLite to PostgreSQL
- Add production Dockerfiles and docker-compose configs
- Add deployment documentation and scripts
- Add BIA sync dashboard and matching service
- Add data completeness configuration and components
- Add new dashboard components (BusinessImportanceComparison, ComplexityDynamics, etc.)
- Update various services and routes
- Remove deprecated management-parameters.json and taxonomy files
2026-01-14 00:38:40 +01:00

52 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
set -e
# Configuration - pas aan naar jouw Gitea instellingen
GITEA_HOST="${GITEA_HOST:-git.zuyderland.nl}"
REPO_PATH="${REPO_PATH:-icmt/cmdb-gui}"
VERSION="${1:-latest}"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${GREEN}🔨 Building Docker images...${NC}"
echo "Registry: ${GITEA_HOST}/${REPO_PATH}"
echo "Version: ${VERSION}"
echo ""
# Check if logged in
if ! docker info | grep -q "Username"; then
echo -e "${YELLOW}⚠️ Not logged in to Docker registry${NC}"
echo "Please login first:"
echo " docker login ${GITEA_HOST}"
exit 1
fi
# Build backend
echo -e "${GREEN}📦 Building backend...${NC}"
docker build -t ${GITEA_HOST}/${REPO_PATH}/backend:${VERSION} \
-f backend/Dockerfile.prod ./backend
# Build frontend
echo -e "${GREEN}📦 Building frontend...${NC}"
docker build -t ${GITEA_HOST}/${REPO_PATH}/frontend:${VERSION} \
-f frontend/Dockerfile.prod ./frontend
# Push images
echo -e "${GREEN}📤 Pushing images to registry...${NC}"
docker push ${GITEA_HOST}/${REPO_PATH}/backend:${VERSION}
docker push ${GITEA_HOST}/${REPO_PATH}/frontend:${VERSION}
echo ""
echo -e "${GREEN}✅ Build and push complete!${NC}"
echo ""
echo "To deploy, run:"
echo " docker-compose -f docker-compose.prod.registry.yml pull"
echo " docker-compose -f docker-compose.prod.registry.yml up -d"
echo ""
echo "Or use the deploy script:"
echo " ./scripts/deploy.sh ${VERSION}"