forked from invertase/react-native-firebase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-firestore.sh
More file actions
executable file
·28 lines (22 loc) · 1.08 KB
/
Copy pathdeploy-firestore.sh
File metadata and controls
executable file
·28 lines (22 loc) · 1.08 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
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# shellcheck source=firebase-cli.sh
source "$SCRIPT_DIR/firebase-cli.sh"
PROJECT="${FIREBASE_PROJECT:-react-native-firebase-testing}"
echo "Deploying Firestore rules and indexes to project: ${PROJECT}"
echo " (default) -> firestore.rules + firestore.indexes.json"
echo " pipelines-e2e -> firestore.pipelines-e2e.rules + firestore.pipelines-e2e.indexes.json"
echo ""
echo "Tip: run ./sync-firestore-indexes.sh first if cloud may have indexes not in repo."
echo ""
"${FIREBASE_CMD[@]}" use "$PROJECT"
# Multi-database Firestore config lives in firebase.deploy.json (not firebase.json).
# firebase.json must stay single-database so the local emulator loads security rules.
# Use full firestore target (not firestore:rules / firestore:indexes) — sub-targets can
# silently no-op with multi-database config.
"${FIREBASE_CMD[@]}" deploy --only firestore --config firebase.deploy.json
echo ""
echo "Running post-deploy index verification..."
"$SCRIPT_DIR/verify-firestore-indexes.sh"