Features: - Add /tournaments command with status and game filters - Add tournament API integration to PlayerService - Add beautiful tournament embed builders with prize pools - Protect sync-games from overwriting manual customizations - Improve error handling with proper MessageFlags Changes: - Add getTournamentsData() and getTournamentData() to PlayerService - Add tournament command handler with pagination support - Add tournament embed builders with rich formatting - Update deployment docs for v1.2.10 features - Add issue tracker documentation - Add tournament testing script - Fix ephemeral flags throughout CommandHandler - Improve permission checks with PermissionFlagsBits Version: 1.2.11
94 lines
2.9 KiB
Bash
Executable File
94 lines
2.9 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# VRBattles Discord Bot - Docker Deploy Script
|
|
# Usage: ./scripts/deploy.sh [version]
|
|
# Example: ./scripts/deploy.sh v1.2.7
|
|
|
|
set -e
|
|
|
|
# Colors for output
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m' # No Color
|
|
|
|
# Configuration
|
|
DOCKER_USERNAME="far54"
|
|
IMAGE_NAME="vrbattles-discord-bot"
|
|
FULL_IMAGE_NAME="${DOCKER_USERNAME}/${IMAGE_NAME}"
|
|
|
|
# Get version from package.json if not provided
|
|
if [ -z "$1" ]; then
|
|
VERSION=$(node -p "require('./package.json').version")
|
|
VERSION="v${VERSION}"
|
|
else
|
|
VERSION="$1"
|
|
fi
|
|
|
|
echo -e "${BLUE}🚀 VRBattles Discord Bot Deployment${NC}"
|
|
echo -e "${YELLOW}📦 Version: ${VERSION}${NC}"
|
|
echo -e "${YELLOW}🐳 Image: ${FULL_IMAGE_NAME}${NC}"
|
|
echo ""
|
|
|
|
# Check if Docker is running
|
|
if ! docker info > /dev/null 2>&1; then
|
|
echo -e "${RED}❌ Docker is not running. Please start Docker and try again.${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
# Sync games from Supabase
|
|
echo -e "${BLUE}🔄 Syncing games from Supabase...${NC}"
|
|
npm run sync-games
|
|
|
|
echo -e "${BLUE}🏗️ Building multi-platform Docker image...${NC}"
|
|
echo -e "${YELLOW}📋 Platforms: linux/amd64, linux/arm64${NC}"
|
|
|
|
# Check if buildx is available
|
|
if ! docker buildx version > /dev/null 2>&1; then
|
|
echo -e "${RED}❌ Docker buildx is not available. Please update Docker.${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
# Create/use buildx builder
|
|
docker buildx create --name multiarch --use --driver docker-container --bootstrap 2>/dev/null || true
|
|
docker buildx use multiarch
|
|
|
|
echo -e "${BLUE}📤 Building and pushing to Docker Hub...${NC}"
|
|
echo -e "${YELLOW}Note: Make sure you're logged in with 'docker login'${NC}"
|
|
|
|
# Check if logged in
|
|
if ! docker info | grep -q "Username:"; then
|
|
echo -e "${YELLOW}⚠️ You don't appear to be logged in to Docker Hub.${NC}"
|
|
echo -e "${YELLOW}🔐 Please run: docker login${NC}"
|
|
read -p "Press Enter after logging in, or Ctrl+C to cancel..."
|
|
fi
|
|
|
|
# Build and push multi-platform images
|
|
docker buildx build --platform linux/amd64,linux/arm64 \
|
|
-t "${FULL_IMAGE_NAME}:latest" \
|
|
-t "${FULL_IMAGE_NAME}:${VERSION}" \
|
|
. --push
|
|
|
|
echo ""
|
|
echo -e "${GREEN}✅ Successfully deployed!${NC}"
|
|
echo ""
|
|
echo -e "${BLUE}📋 Deployment Summary:${NC}"
|
|
echo -e " 🐳 Images pushed:"
|
|
echo -e " • ${FULL_IMAGE_NAME}:latest"
|
|
echo -e " • ${FULL_IMAGE_NAME}:${VERSION}"
|
|
echo ""
|
|
echo -e "${BLUE}🔧 Coolify Deployment:${NC}"
|
|
echo -e " 1. Go to your Coolify dashboard"
|
|
echo -e " 2. Update your application image to: ${FULL_IMAGE_NAME}:${VERSION}"
|
|
echo -e " 3. Restart the application"
|
|
echo ""
|
|
echo -e "${BLUE}🎯 Features in this version:${NC}"
|
|
echo -e " ✅ NEW: /tournaments command with filtering"
|
|
echo -e " ✅ Tournament status & game filters"
|
|
echo -e " ✅ Beautiful tournament embeds with prizes"
|
|
echo -e " ✅ All 9 games in dropdowns"
|
|
echo -e " ✅ Working help button navigation"
|
|
echo -e " ✅ Automatic Supabase game sync"
|
|
echo ""
|
|
echo -e "${GREEN}🎉 Deployment complete!${NC}" |