- 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
72 lines
1.8 KiB
Bash
Executable File
72 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
VERSION="${1:-latest}"
|
|
COMPOSE_FILE="docker-compose.prod.registry.yml"
|
|
|
|
# Colors for output
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m' # No Color
|
|
|
|
echo -e "${GREEN}🚀 Deploying version: ${VERSION}${NC}"
|
|
echo ""
|
|
|
|
# Check if compose file exists
|
|
if [ ! -f "$COMPOSE_FILE" ]; then
|
|
echo -e "${RED}❌ Compose file not found: ${COMPOSE_FILE}${NC}"
|
|
echo "Please create it first (see docs/GITEA-DOCKER-REGISTRY.md)"
|
|
exit 1
|
|
fi
|
|
|
|
# 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
|
|
|
|
# Update image tags in compose file if using version tags
|
|
if [ "$VERSION" != "latest" ]; then
|
|
echo -e "${YELLOW}📝 Updating image tags to v${VERSION}...${NC}"
|
|
# Create backup
|
|
cp ${COMPOSE_FILE} ${COMPOSE_FILE}.bak
|
|
# Replace :latest with :v${VERSION} in image tags
|
|
sed -i.tmp "s|:latest|:v${VERSION}|g" ${COMPOSE_FILE}
|
|
rm ${COMPOSE_FILE}.tmp 2>/dev/null || true
|
|
fi
|
|
|
|
# Pull latest images
|
|
echo -e "${GREEN}📥 Pulling images...${NC}"
|
|
docker-compose -f ${COMPOSE_FILE} pull
|
|
|
|
# Deploy
|
|
echo -e "${GREEN}🚀 Starting services...${NC}"
|
|
docker-compose -f ${COMPOSE_FILE} up -d
|
|
|
|
# Wait a bit for services to start
|
|
echo -e "${YELLOW}⏳ Waiting for services to start...${NC}"
|
|
sleep 5
|
|
|
|
# Show status
|
|
echo -e "${GREEN}📊 Service status:${NC}"
|
|
docker-compose -f ${COMPOSE_FILE} ps
|
|
|
|
# Cleanup old images (optional)
|
|
echo -e "${YELLOW}🧹 Cleaning up unused images...${NC}"
|
|
docker image prune -f
|
|
|
|
echo ""
|
|
echo -e "${GREEN}✅ Deployment complete!${NC}"
|
|
echo ""
|
|
echo "View logs:"
|
|
echo " docker-compose -f ${COMPOSE_FILE} logs -f"
|
|
echo ""
|
|
echo "Check status:"
|
|
echo " docker-compose -f ${COMPOSE_FILE} ps"
|
|
echo ""
|
|
echo "Stop services:"
|
|
echo " docker-compose -f ${COMPOSE_FILE} down"
|