-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy-cloudrun.sh
More file actions
50 lines (43 loc) · 1.36 KB
/
deploy-cloudrun.sh
File metadata and controls
50 lines (43 loc) · 1.36 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
44
45
46
47
48
49
50
#!/bin/bash
# Deploy ADK Interviewer to Google Cloud Run
# Optimized for Free Tier
set -e
# Configuration
PROJECT_ID="${GOOGLE_CLOUD_PROJECT:-your-project-id}"
REGION="${GCP_REGION:-us-central1}"
SERVICE_NAME="ai-interviewer-adk"
IMAGE_NAME="gcr.io/${PROJECT_ID}/${SERVICE_NAME}"
echo "🚀 Deploying AI Interviewer (ADK) to Cloud Run"
echo "=============================================="
echo "Project: ${PROJECT_ID}"
echo "Region: ${REGION}"
echo "Service: ${SERVICE_NAME}"
echo ""
# Step 1: Build container
echo "📦 Building container..."
docker build -f Dockerfile -t ${IMAGE_NAME}:latest .
# Step 2: Push to GCR
echo "⬆️ Pushing to Container Registry..."
docker push ${IMAGE_NAME}:latest
# Step 3: Deploy to Cloud Run
echo "🌐 Deploying to Cloud Run..."
gcloud run deploy ${SERVICE_NAME} \
--image ${IMAGE_NAME}:latest \
--platform managed \
--region ${REGION} \
--allow-unauthenticated \
--memory 256Mi \
--cpu 1 \
--min-instances 0 \
--max-instances 1 \
--timeout 300 \
--set-secrets "GOOGLE_API_KEY=google-api-key:latest"
# Step 4: Get URL
echo ""
echo "✅ Deployment complete!"
echo ""
SERVICE_URL=$(gcloud run services describe ${SERVICE_NAME} --region ${REGION} --format 'value(status.url)')
echo "🔗 Service URL: ${SERVICE_URL}"
echo ""
echo "To view logs:"
echo " gcloud run logs read ${SERVICE_NAME} --region ${REGION}"