#!/bin/bash # Master Deployment Script for Mnemo Cards # Usage: ./deploy_all.sh [options] # Options: # --web-only Deploy only the web application # --backend-only Deploy only the backend # --help Show this help message set -e # Configuration WEB_DEPLOY_SCRIPT="./mnemo_cards_web_v2/deploy.sh" BACKEND_DEPLOY_SCRIPT="./tools/deploy/backend/deploy_remote.sh" # Colors GREEN='\033[0;32m' BLUE='\033[0;34m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # Helper functions print_info() { echo -e "${BLUE}[INFO]${NC} $1" } print_success() { echo -e "${GREEN}[SUCCESS]${NC} $1" } print_warning() { echo -e "${YELLOW}[WARNING]${NC} $1" } show_help() { echo "Usage: ./deploy_all.sh [options]" echo "Options:" echo " --web-only Deploy only the web application" echo " --backend-only Deploy only the backend" echo " --help Show this help message" echo "" echo "If no options are provided, both web and backend will be deployed." } # Parse arguments DEPLOY_WEB=true DEPLOY_BACKEND=true if [ "$1" == "--web-only" ]; then DEPLOY_BACKEND=false elif [ "$1" == "--backend-only" ]; then DEPLOY_WEB=false elif [ "$1" == "--help" ]; then show_help exit 0 fi # Main execution echo "🚀 Starting Mnemo Cards Deployment..." if [ "$DEPLOY_BACKEND" = true ]; then print_info "Starting Backend Deployment..." if [ -f "$BACKEND_DEPLOY_SCRIPT" ]; then bash "$BACKEND_DEPLOY_SCRIPT" else print_warning "Backend deploy script not found at $BACKEND_DEPLOY_SCRIPT" exit 1 fi fi if [ "$DEPLOY_WEB" = true ]; then print_info "Starting Web Deployment..." if [ -f "$WEB_DEPLOY_SCRIPT" ]; then bash "$WEB_DEPLOY_SCRIPT" else print_warning "Web deploy script not found at $WEB_DEPLOY_SCRIPT" exit 1 fi fi print_success "Deployment process finished! 🎉"