Fix install script build issues for fresh deployments
Some checks are pending
CI Pipeline / Run Tests (push) Waiting to run
CI Pipeline / Lint Code (push) Waiting to run
CI Pipeline / Security Scan (push) Waiting to run
CI Pipeline / E2E Tests (push) Blocked by required conditions

This commit is contained in:
Enki 2025-08-27 14:16:06 -07:00
parent 66162fdb1a
commit 669ec281a2
3 changed files with 14 additions and 29 deletions

4
go.mod
View File

@ -1,6 +1,8 @@
module git.sovbit.dev/enki/torrentGateway
go 1.24
go 1.24.1
toolchain go1.24.4
require (
github.com/anacrolix/torrent v1.58.1

View File

@ -8,6 +8,9 @@ set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
# Ensure we're in the project root
cd "$PROJECT_ROOT"
echo "🚀 Torrent Gateway Native Installation"
echo "======================================"
@ -21,6 +24,12 @@ fi
# Parse arguments
ENABLE_MONITORING=false
SKIP_BUILD=false
# Check if binary already exists and skip build if so
if [ -f "bin/gateway" ]; then
echo "✅ Found existing binary at bin/gateway - skipping build"
SKIP_BUILD=true
fi
DOMAIN=""
EMAIL=""
SKIP_SSL=false
@ -185,29 +194,14 @@ echo "✅ Go $GO_VERSION installed"
if [ "$SKIP_BUILD" = false ]; then
echo "🔨 Building Torrent Gateway..."
# Debug: Show environment and current directory
echo "DEBUG: Current working directory: $(pwd)"
echo "DEBUG: GOPATH: ${GOPATH:-'not set'}"
echo "DEBUG: GOROOT: ${GOROOT:-'not set'}"
echo "DEBUG: Contents of current directory:"
ls -la | head -10
echo "DEBUG: Check if cmd/gateway exists:"
if [ -d "cmd/gateway" ]; then
echo " ✅ cmd/gateway directory exists"
ls -la cmd/gateway/
else
echo " ❌ cmd/gateway directory does NOT exist"
fi
# Install Go dependencies
go mod download
# Create bin directory if it doesn't exist
mkdir -p bin
# Build binary with verbose output
echo "DEBUG: Running go build command..."
go build -v -o bin/gateway \
# Build binary
go build -o bin/gateway \
-ldflags "-X main.version=$(git describe --tags --always 2>/dev/null || echo 'dev') -X main.buildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ) -s -w" \
./cmd/gateway

View File

@ -49,17 +49,6 @@ done
cd "$PROJECT_ROOT"
# Debug: print current directory and check if cmd/gateway exists
echo "DEBUG: Current directory: $(pwd)"
echo "DEBUG: Contents of current directory:"
ls -la | head -10
if [ -d "cmd/gateway" ]; then
echo "DEBUG: cmd/gateway directory exists"
else
echo "DEBUG: cmd/gateway directory does NOT exist"
echo "DEBUG: Looking for cmd directory:"
find . -name "cmd" -type d 2>/dev/null | head -5
fi
# Install dependencies
echo "📦 Installing system dependencies..."