-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-production.sh
More file actions
executable file
Β·42 lines (34 loc) Β· 1.32 KB
/
deploy-production.sh
File metadata and controls
executable file
Β·42 lines (34 loc) Β· 1.32 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
#!/bin/bash
# Production Deployment Script for dmtools App Engine
echo "π Starting production deployment to App Engine..."
# Check if GEMINI_API_KEY is set in app.yaml
if grep -q "YOUR_GEMINI_API_KEY_HERE" app.yaml; then
echo "β οΈ WARNING: Please update GEMINI_API_KEY in app.yaml before deploying!"
echo " Edit app.yaml and replace 'YOUR_GEMINI_API_KEY_HERE' with your actual Gemini API key."
read -p " Have you updated the API key? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "β Deployment cancelled. Please update the API key first."
exit 1
fi
fi
# Build the application for production
echo "π¨ Building application for production..."
./gradlew clean bootJar -PbuildProfile=production -x test
if [ $? -ne 0 ]; then
echo "β Build failed! Please fix compilation errors."
exit 1
fi
echo "β
Build successful!"
# Deploy to App Engine
echo "βοΈ Deploying to App Engine..."
gcloud app deploy app.yaml --quiet
if [ $? -eq 0 ]; then
echo "β
Deployment successful!"
echo "π Your application is available at: https://$(gcloud config get-value project).lm.r.appspot.com"
echo "π To view logs: gcloud app logs read --service=default"
echo "π± To open in browser: gcloud app browse"
else
echo "β Deployment failed!"
exit 1
fi