-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
45 lines (35 loc) · 1.58 KB
/
install.sh
File metadata and controls
45 lines (35 loc) · 1.58 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
#!/usr/bin/env bash
set -euo pipefail
# Setup script for a new WordPress VM on GCP
# curl -fsSL https://raw.githubusercontent.com/renderbit-technologies/WordPress-GCP-VM-Setup/main/install.sh -o install.sh && sudo bash install.sh && sudo rm install.sh
# Run as root on Ubuntu/Debian: sudo bash install.sh
if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root: sudo $0"
exit 1
fi
# Base Gist URL (without commit hash to ensure HEAD/latest version)
BASE_URL="https://raw.githubusercontent.com/renderbit-technologies/WordPress-GCP-VM-Setup/main"
echo "-----------------------------------------------------"
echo "Fetching latest deployment scripts (HEAD revision)..."
echo "-----------------------------------------------------"
# Download the files explicitly to disk
# This preserves stdin so interactive prompts in the sub-scripts will work
curl -fsSL "${BASE_URL}/setup-swap.sh" -o setup-swap.sh
curl -fsSL "${BASE_URL}/setup-wp-nginx.sh" -o setup-wp-nginx.sh
# Make them executable
chmod +x setup-swap.sh setup-wp-nginx.sh
echo "-----------------------------------------------------"
echo "Step 1/2: Setting up Swap"
echo "-----------------------------------------------------"
bash ./setup-swap.sh
echo
echo "-----------------------------------------------------"
echo "Step 2/2: Installing WordPress stack"
echo "-----------------------------------------------------"
bash ./setup-wp-nginx.sh
# Cleanup
rm setup-swap.sh setup-wp-nginx.sh
echo
echo "-----------------------------------------------------"
echo "All steps completed successfully."
echo "-----------------------------------------------------"