forked from muratcankoylan/actual_code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_credentials.sh
More file actions
53 lines (45 loc) · 1.43 KB
/
Copy pathsetup_credentials.sh
File metadata and controls
53 lines (45 loc) · 1.43 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
#!/bin/bash
# Setup script for Google Cloud credentials
echo "🔐 Google Cloud Authentication Setup"
echo "======================================"
echo ""
echo "Choose an option:"
echo " 1) Use service account key file"
echo " 2) Install gcloud CLI (recommended)"
echo ""
read -p "Enter your choice (1 or 2): " choice
if [ "$choice" = "1" ]; then
echo ""
read -p "Enter the path to your service account key JSON file: " key_path
if [ -f "$key_path" ]; then
export GOOGLE_APPLICATION_CREDENTIALS="$key_path"
echo ""
echo "✅ Credentials set!"
echo ""
echo "Add this to your .env file:"
echo "GOOGLE_APPLICATION_CREDENTIALS=$key_path"
echo ""
echo "Or run this command to set it for this session:"
echo "export GOOGLE_APPLICATION_CREDENTIALS=\"$key_path\""
else
echo "❌ File not found: $key_path"
exit 1
fi
elif [ "$choice" = "2" ]; then
echo ""
echo "Installing Google Cloud CLI via Homebrew..."
if ! command -v brew &> /dev/null; then
echo "❌ Homebrew not found. Install it from https://brew.sh"
exit 1
fi
brew install google-cloud-sdk
echo ""
echo "✅ gcloud CLI installed!"
echo ""
echo "Now run these commands:"
echo " gcloud auth application-default login"
echo " gcloud config set project ActualCode"
else
echo "Invalid choice"
exit 1
fi