Major Changes: - Migrate UI to Shadcn components with Tailwind CSS v3 - Implement dark theme as default with improved color scheme - Optimize homepage layout to fit single screen without scrolling - Fix chart visibility with explicit colors for dark mode Deployment Infrastructure: - Add Docker multi-stage build with Nginx + Node.js - Create Kubernetes manifests (deployment, service, ingress, PVC) - Configure Gitea CI/CD workflow with registry integration - Add deployment scripts with registry support CI/CD Configuration: - Registry: gitea.vidoks.fr/sortifal/pfee - Automatic build and push on commits - Kubernetes deployment with image pull secrets - Three-stage pipeline: build, deploy, notify Documentation: - Add DEPLOYMENT.md with comprehensive deployment guide - Add SETUP-REGISTRY.md with step-by-step registry setup - Add workflow README with troubleshooting guide - Include configuration examples and best practices 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
80 lines
2.3 KiB
Bash
Executable File
80 lines
2.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# SQDC Dashboard Deployment Script
|
|
# Usage: ./scripts/deploy.sh [registry_url] [registry_user] [registry_password] [repository_path]
|
|
|
|
set -e
|
|
|
|
REGISTRY_URL=${1:-"gitea.vidoks.fr"}
|
|
REGISTRY_USER=${2}
|
|
REGISTRY_PASSWORD=${3}
|
|
REPOSITORY_PATH=${4:-"sortifal/pfee"}
|
|
NAMESPACE="sqdc-dashboard"
|
|
|
|
echo "🚀 Deploying SQDC Dashboard..."
|
|
|
|
# Check if registry credentials are provided
|
|
if [ -z "$REGISTRY_USER" ] || [ -z "$REGISTRY_PASSWORD" ]; then
|
|
echo "⚠️ Warning: Registry credentials not provided. Using local image."
|
|
REGISTRY_URL="local"
|
|
fi
|
|
|
|
# Build Docker image
|
|
echo "📦 Building Docker image..."
|
|
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
|
|
|
|
if [ "$REGISTRY_URL" != "local" ]; then
|
|
# Login to registry
|
|
echo "🔐 Logging in to registry..."
|
|
echo "$REGISTRY_PASSWORD" | docker login $REGISTRY_URL -u $REGISTRY_USER --password-stdin
|
|
|
|
# Build and push to registry
|
|
IMAGE_NAME="$REGISTRY_URL/$REPOSITORY_PATH"
|
|
docker build -t $IMAGE_NAME:$TIMESTAMP .
|
|
docker tag $IMAGE_NAME:$TIMESTAMP $IMAGE_NAME:latest
|
|
docker push $IMAGE_NAME:$TIMESTAMP
|
|
docker push $IMAGE_NAME:latest
|
|
echo "✅ Docker image pushed: $IMAGE_NAME:$TIMESTAMP"
|
|
else
|
|
# Build local image
|
|
docker build -t sqdc-dashboard:latest .
|
|
docker tag sqdc-dashboard:latest sqdc-dashboard:$TIMESTAMP
|
|
echo "✅ Docker image built: sqdc-dashboard:$TIMESTAMP"
|
|
fi
|
|
|
|
# Apply Kubernetes manifests
|
|
echo "☸️ Applying Kubernetes manifests..."
|
|
kubectl apply -f k8s/namespace.yaml
|
|
|
|
# Create registry secret if credentials provided
|
|
if [ "$REGISTRY_URL" != "local" ]; then
|
|
echo "🔑 Creating registry credentials secret..."
|
|
kubectl create secret docker-registry registry-credentials \
|
|
--docker-server=$REGISTRY_URL \
|
|
--docker-username=$REGISTRY_USER \
|
|
--docker-password=$REGISTRY_PASSWORD \
|
|
-n $NAMESPACE \
|
|
--dry-run=client -o yaml | kubectl apply -f -
|
|
fi
|
|
|
|
kubectl apply -f k8s/deployment.yaml
|
|
kubectl apply -f k8s/service.yaml
|
|
kubectl apply -f k8s/ingress.yaml
|
|
|
|
# Wait for rollout
|
|
echo "⏳ Waiting for deployment to complete..."
|
|
kubectl rollout status deployment/sqdc-dashboard -n $NAMESPACE --timeout=5m
|
|
|
|
# Display deployment info
|
|
echo ""
|
|
echo "📊 Deployment Status:"
|
|
kubectl get pods -n $NAMESPACE
|
|
echo ""
|
|
kubectl get svc -n $NAMESPACE
|
|
echo ""
|
|
kubectl get ingress -n $NAMESPACE
|
|
|
|
echo ""
|
|
echo "✅ Deployment complete!"
|
|
echo "🌐 Access the dashboard at: http://sqdc-dashboard.local"
|