-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
123 lines (103 loc) · 2.9 KB
/
install.sh
File metadata and controls
123 lines (103 loc) · 2.9 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
# n8n Cloud Deploy - One-Liner Installer
# Downloads all necessary files and starts deployment
set -e
REPO_URL="https://raw.githubusercontent.com/llmx-de/n8n-cloud-deploy/main"
INSTALL_DIR="$HOME/n8n-cloud-deploy"
echo "========================================="
echo "n8n Cloud Deploy - Installer"
echo "========================================="
echo ""
echo "This will download and set up n8n deployment tools"
echo "Installation directory: $INSTALL_DIR"
echo ""
# Check prerequisites
echo "Checking prerequisites..."
if ! command -v gcloud &> /dev/null; then
echo ""
echo "❌ Error: gcloud CLI not found!"
echo ""
echo "Please install Google Cloud SDK first:"
echo " https://cloud.google.com/sdk/docs/install"
echo ""
exit 1
fi
if ! command -v curl &> /dev/null; then
echo ""
echo "❌ Error: curl not found!"
echo "Please install curl and try again."
echo ""
exit 1
fi
echo "✓ gcloud CLI found"
echo "✓ curl found"
# Create installation directory
echo ""
echo "Creating installation directory..."
mkdir -p "$INSTALL_DIR"
mkdir -p "$INSTALL_DIR/templates"
cd "$INSTALL_DIR"
echo "✓ Directory created: $INSTALL_DIR"
# Download main scripts
echo ""
echo "Downloading deployment scripts..."
download_file() {
local file=$1
local url="$REPO_URL/$file"
if curl -fsSL "$url" -o "$file" 2>/dev/null; then
echo "✓ Downloaded: $file"
return 0
else
echo "❌ Failed to download: $file"
return 1
fi
}
# Download scripts
download_file "provision-cloud.sh" || exit 1
download_file "setup-instance.sh" || exit 1
download_file "cleanup.sh" || exit 1
# Download templates
echo ""
echo "Downloading configuration templates..."
download_file "templates/docker-compose.yml" || exit 1
download_file "templates/Caddyfile" || exit 1
# .env file - create inline as GitHub doesn't serve hidden files well via raw URLs
echo "Creating templates/.env..."
cat > "templates/.env" << 'EOF'
N8N_HOST=__DOMAIN_NAME__
N8N_PORT=5678
N8N_PROTOCOL=https
WEBHOOK_URL=https://__DOMAIN_NAME__/
GENERIC_TIMEZONE=Europe/Berlin
EOF
echo "✓ Created: templates/.env"
# Download documentation
echo ""
echo "Downloading documentation..."
download_file "README.md" || true
download_file "SECURITY.md" || true
# Set execute permissions
echo ""
echo "Setting permissions..."
chmod +x provision-cloud.sh
chmod +x setup-instance.sh
chmod +x cleanup.sh
echo "✓ Permissions set"
echo ""
echo "========================================="
echo "✓ Installation complete!"
echo "========================================="
echo ""
echo "Files downloaded to: $INSTALL_DIR"
echo ""
echo "Starting deployment in 3 seconds..."
echo "Press Ctrl+C to cancel and deploy later"
echo ""
# Give user 3 seconds to cancel
sleep 1 && echo "3..." || exit 0
sleep 1 && echo "2..." || exit 0
sleep 1 && echo "1..." || exit 0
echo ""
echo "🚀 Starting deployment..."
echo ""
./provision-cloud.sh