-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·43 lines (33 loc) · 1.19 KB
/
deploy.sh
File metadata and controls
executable file
·43 lines (33 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# StudyWise AI - Google Cloud Run Deployment Script
set -e
# Configuration
PROJECT_ID="your-project-id"
SERVICE_NAME="studywise-api"
REGION="us-central1"
echo "🚀 Deploying StudyWise AI to Google Cloud Run..."
# Check if gcloud is installed
if ! command -v gcloud &> /dev/null; then
echo "❌ Google Cloud SDK not found. Install from: https://cloud.google.com/sdk/docs/install"
exit 1
fi
# Set project
echo "📋 Setting project to $PROJECT_ID..."
gcloud config set project $PROJECT_ID
# Enable required APIs
echo "🔧 Enabling required APIs..."
gcloud services enable cloudbuild.googleapis.com
gcloud services enable run.googleapis.com
gcloud services enable containerregistry.googleapis.com
# Build and deploy
echo "🏗️ Building and deploying..."
gcloud builds submit --config cloudbuild.yaml
# Get service URL
SERVICE_URL=$(gcloud run services describe $SERVICE_NAME --region=$REGION --format="value(status.url)")
echo "✅ Deployment complete!"
echo "🌐 Service URL: $SERVICE_URL"
echo ""
echo "📝 Next steps:"
echo "1. Update your frontend API URL to: $SERVICE_URL"
echo "2. Set environment variables in Cloud Run console"
echo "3. Configure custom domain (optional)"