| # deploy_dev.sh - Tutor Mode Deployment Script (DEV) | |
| # V3.18.0 - Includes Phase C Environment Variables | |
| PROJECT_ID="buddy-math-dev" | |
| SERVICE_NAME="buddy-math-server" | |
| REGION="europe-west3" # Change if needed | |
| IMAGE_NAME="gcr.io/$PROJECT_ID/$SERVICE_NAME" | |
| echo "๐ Starting Deployment for BuddyMath Server (DEV)..." | |
| # 1. Check for gcloud | |
| if ! command -v gcloud &> /dev/null | |
| then | |
| echo "โ gcloud CLI not found. Please install it: https://cloud.google.com/sdk/docs/install" | |
| exit | |
| fi | |
| # 2. Set Project | |
| echo "๐ Setting GCP Project to $PROJECT_ID..." | |
| gcloud config set project $PROJECT_ID | |
| # 3. Build Image using Cloud Build | |
| echo "๐๏ธ Submitting build to Cloud Build..." | |
| gcloud builds submit --tag $IMAGE_NAME . | |
| # 4. Deploy to Cloud Run | |
| echo "โ๏ธ Deploying to Cloud Run..." | |
| gcloud run deploy $SERVICE_NAME \ | |
| --image $IMAGE_NAME \ | |
| --platform managed \ | |
| --region $REGION \ | |
| --allow-unauthenticated \ | |
| --set-env-vars "ENV=development,OCR_STRIP_MODE=development" | |
| echo "โ Deployment Complete!" | |
| # 5. Reminder for Storage Lifecycle | |
| echo -e "\n๐ [IMPORTANT] Don't forget to apply the Storage Lifecycle Rule if you haven't yet:" | |
| echo "gsutil lifecycle set gcs_lifecycle_rule.json gs://buddy-math-dev.firebasestorage.app" | |