Add x86_64 support to deployment script
- Add architecture detection for both ARM64 and x86_64 - Dynamically download correct Go binary based on architecture - Add debug output to show detected architecture - Handle 32-bit ARM with clear error message - Update script header to indicate multi-architecture support 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
eaadf6e4b8
commit
ad6cc45328
1 changed files with 37 additions and 6 deletions
|
@ -1,12 +1,41 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Great Lakes Ice Report Deployment Script for Debian 12 ARM64
|
||||
# Run this script on your server: drone@91.99.139.235
|
||||
# Great Lakes Ice Report Deployment Script for Debian 12 (ARM64/x86_64)
|
||||
# Supports both ARM64 and x86_64 architectures
|
||||
|
||||
set -e
|
||||
|
||||
echo "🚀 Starting Great Lakes Ice Report deployment..."
|
||||
|
||||
# Detect architecture
|
||||
ARCH=$(uname -m)
|
||||
echo "🔍 Raw architecture from uname -m: $ARCH"
|
||||
|
||||
# Also check dpkg architecture as fallback
|
||||
DPKG_ARCH=$(dpkg --print-architecture 2>/dev/null || echo "unknown")
|
||||
echo "🔍 dpkg architecture: $DPKG_ARCH"
|
||||
|
||||
case $ARCH in
|
||||
x86_64|amd64)
|
||||
GO_ARCH="amd64"
|
||||
echo "📋 Detected x86_64 architecture"
|
||||
;;
|
||||
aarch64|arm64)
|
||||
GO_ARCH="arm64"
|
||||
echo "📋 Detected ARM64 architecture"
|
||||
;;
|
||||
armv7l|armhf)
|
||||
echo "❌ Detected 32-bit ARM architecture"
|
||||
echo "This script requires 64-bit architecture (x86_64 or ARM64)."
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "❌ Unsupported architecture: $ARCH"
|
||||
echo "This script supports x86_64 and ARM64 only."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Update system
|
||||
echo "📦 Updating system packages..."
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
|
@ -17,10 +46,12 @@ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
|||
sudo apt install -y nodejs build-essential
|
||||
|
||||
# Install Go (required for xcaddy)
|
||||
echo "📦 Installing Go..."
|
||||
wget -q https://go.dev/dl/go1.21.5.linux-arm64.tar.gz
|
||||
echo "📦 Installing Go for $GO_ARCH architecture..."
|
||||
GO_VERSION="1.21.5"
|
||||
GO_TARBALL="go${GO_VERSION}.linux-${GO_ARCH}.tar.gz"
|
||||
wget -q "https://go.dev/dl/${GO_TARBALL}"
|
||||
sudo rm -rf /usr/local/go
|
||||
sudo tar -C /usr/local -xzf go1.21.5.linux-arm64.tar.gz
|
||||
sudo tar -C /usr/local -xzf "${GO_TARBALL}"
|
||||
export PATH=$PATH:/usr/local/go/bin
|
||||
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
|
||||
|
||||
|
@ -71,7 +102,7 @@ WantedBy=multi-user.target
|
|||
EOF
|
||||
|
||||
# Clean up Go archive
|
||||
rm -f go1.21.5.linux-arm64.tar.gz
|
||||
rm -f "${GO_TARBALL}"
|
||||
|
||||
echo "✅ Caddy with rate limiting plugin installed successfully!"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue