-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
60 lines (49 loc) Β· 1.61 KB
/
deploy.sh
File metadata and controls
60 lines (49 loc) Β· 1.61 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
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Firebase Deployment Script
# This script deploys your WhatsApp Appointment Manager to Firebase
set -e # Exit on error
echo "π Starting Firebase Deployment..."
echo "=================================="
# Check if Firebase CLI is installed
if ! command -v firebase &> /dev/null; then
echo "β Firebase CLI not found!"
echo "Install it with: npm install -g firebase-tools"
exit 1
fi
echo "β
Firebase CLI found"
# Check if logged in
if ! firebase projects:list &> /dev/null; then
echo "π Please login to Firebase..."
firebase login
fi
echo "β
Firebase authentication successful"
# Initialize Firebase if not done
if [ ! -f ".firebaserc" ]; then
echo "π§ Initializing Firebase project..."
firebase init
fi
# Deploy Firestore rules and indexes
echo "π Deploying Firestore configuration..."
firebase deploy --only firestore
# Deploy Cloud Functions
echo "β‘ Deploying Cloud Functions..."
firebase deploy --only functions
echo ""
echo "=================================="
echo "β
Deployment Complete!"
echo "=================================="
echo ""
echo "π± Your Twilio Webhook URL:"
echo " https://YOUR-REGION-YOUR-PROJECT.cloudfunctions.net/whatsapp_webhook"
echo ""
echo "π§ Next Steps:"
echo " 1. Copy the webhook URL from the output above"
echo " 2. Go to Twilio Console: https://console.twilio.com"
echo " 3. Configure WhatsApp webhook with your URL"
echo " 4. Test by sending 'book' to your WhatsApp number"
echo ""
echo "π View logs:"
echo " firebase functions:log --only whatsapp_webhook"
echo ""
echo "π Your WhatsApp bot is now live!"
echo ""