#!/bin/bash # Deploy documentation to production set -e DEPLOY_HOST=${DEPLOY_HOST:-docs.datacenter.local} DEPLOY_USER=${DEPLOY_USER:-automation} echo "Deploying to $DEPLOY_HOST..." # Build documentation ./scripts/build-docs.sh # Build Docker image echo "Building Docker image..." docker-compose build docs-server # Push to registry (if configured) if [ -n "$DOCKER_REGISTRY" ]; then echo "Pushing to registry..." docker-compose push docs-server fi # Deploy via SSH echo "Deploying to server..." ssh $DEPLOY_USER@$DEPLOY_HOST << 'ENDSSH' cd /opt/datacenter-docs git pull origin main docker-compose pull docs-server docker-compose up -d docs-server # Health check sleep 5 curl -f http://localhost:8000/health || exit 1 ENDSSH echo "✓ Deployment successful!"