Improve MySQL runtime settings and playerbot-aware staging

This commit is contained in:
Deckard
2025-10-19 05:45:47 -04:00
parent bd0503b492
commit 3764a5ec51
2 changed files with 39 additions and 26 deletions

View File

@@ -17,26 +17,26 @@ KEEP_RUNNING=0
SKIP_REBUILD=0 SKIP_REBUILD=0
BLUE='\033[0;34m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; RED='\033[0;31m'; NC='\033[0m' BLUE='\033[0;34m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; RED='\033[0;31m'; NC='\033[0m'
info(){ echo -e "${BLUE} $*${NC}"; } info(){ printf '%b\n' "${BLUE} $*${NC}"; }
ok(){ echo -e "${GREEN}$*${NC}"; } ok(){ printf '%b\n' "${GREEN}$*${NC}"; }
warn(){ echo -e "${YELLOW}⚠️ $*${NC}"; } warn(){ printf '%b\n' "${YELLOW}⚠️ $*${NC}"; }
err(){ echo -e "${RED}$*${NC}"; } err(){ printf '%b\n' "${RED}$*${NC}"; }
show_deployment_header(){ show_deployment_header(){
echo -e "\n${BLUE} ⚔️ AZEROTHCORE REALM DEPLOYMENT ⚔️${NC}" printf '\n%b\n' "${BLUE}⚔️ AZEROTHCORE REALM DEPLOYMENT ⚔️${NC}"
echo -e "${BLUE} ════════════════════════════════════${NC}" printf '%b\n' "${BLUE}════════════════════════════════════════${NC}"
echo -e "${BLUE} 🏰 Bringing Your Realm Online 🏰${NC}\n" printf '%b\n\n' "${BLUE}🏰 Bringing Your Realm Online 🏰${NC}"
} }
show_step(){ show_step(){
local step="$1" total="$2" message="$3" local step="$1" total="$2" message="$3"
echo -e "${YELLOW}🔧 Step ${step}/${total}: ${message}...${NC}" printf '%b\n' "${YELLOW}🔧 Step ${step}/${total}: ${message}...${NC}"
} }
show_realm_ready(){ show_realm_ready(){
echo -e "\n${GREEN}⚔️ The realm has been forged! ⚔️${NC}" printf '\n%b\n' "${GREEN}⚔️ The realm has been forged! ⚔️${NC}"
echo -e "${GREEN}🏰 Adventurers may now enter your world${NC}" printf '%b\n' "${GREEN}🏰 Adventurers may now enter your world${NC}"
echo -e "${GREEN}🗡️ May your server bring epic adventures!${NC}\n" printf '%b\n\n' "${GREEN}🗡️ May your server bring epic adventures!${NC}"
} }
usage(){ usage(){
@@ -171,6 +171,16 @@ rebuild_source(){
} }
tag_module_images(){ tag_module_images(){
local module_playerbots
local playerbot_enabled
module_playerbots="$(read_env MODULE_PLAYERBOTS "0")"
playerbot_enabled="$(read_env PLAYERBOT_ENABLED "0")"
if [ "$module_playerbots" = "1" ] || [ "$playerbot_enabled" = "1" ]; then
info "Playerbot mode detected; skipping module image tagging."
return
fi
local source_world="acore/ac-wotlk-worldserver:master" local source_world="acore/ac-wotlk-worldserver:master"
local source_auth="acore/ac-wotlk-authserver:master" local source_auth="acore/ac-wotlk-authserver:master"
local target_world local target_world

View File

@@ -7,14 +7,14 @@ set -e
BLUE='\033[0;34m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m' BLUE='\033[0;34m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m'
show_staging_header(){ show_staging_header(){
echo -e "\n${BLUE} ⚔️ REALM STAGING SYSTEM ⚔️${NC}" printf '\n%b\n' "${BLUE}⚔️ REALM STAGING SYSTEM ⚔️${NC}"
echo -e "${BLUE} ══════════════════════════════${NC}" printf '%b\n' "${BLUE}══════════════════════════════${NC}"
echo -e "${BLUE} 🎯 Configuring Your Realm 🎯${NC}\n" printf '%b\n\n' "${BLUE}🎯 Configuring Your Realm 🎯${NC}"
} }
show_staging_step(){ show_staging_step(){
local step="$1" message="$2" local step="$1" message="$2"
echo -e "${YELLOW}🔧 ${step}: ${message}...${NC}" printf '%b\n' "${YELLOW}🔧 ${step}: ${message}...${NC}"
} }
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -147,16 +147,19 @@ MODULE_PLAYERBOTS="$(read_env MODULE_PLAYERBOTS "0")"
# Determine target profile if not specified # Determine target profile if not specified
if [ -z "$TARGET_PROFILE" ]; then if [ -z "$TARGET_PROFILE" ]; then
show_staging_step "Profile Detection" "Analyzing enabled modules" show_staging_step "Profile Detection" "Analyzing enabled modules"
if [ ${#compile_modules[@]} -gt 0 ]; then if [ "$MODULE_PLAYERBOTS" = "1" ] || [ "$PLAYERBOT_ENABLED" = "1" ]; then
TARGET_PROFILE="playerbots"
echo "🤖 Playerbot profile enabled"
if [ ${#compile_modules[@]} -gt 0 ]; then
echo " ⚠️ Detected ${#compile_modules[@]} C++ modules. Ensure your playerbot images include these features."
fi
elif [ ${#compile_modules[@]} -gt 0 ]; then
echo "🔧 Detected ${#compile_modules[@]} C++ modules requiring compilation:" echo "🔧 Detected ${#compile_modules[@]} C++ modules requiring compilation:"
for mod in "${compile_modules[@]}"; do for mod in "${compile_modules[@]}"; do
echo "$mod" echo "$mod"
done done
TARGET_PROFILE="modules" TARGET_PROFILE="modules"
echo "🧩 Using modules profile for custom source build" echo "🧩 Using modules profile for custom source build"
elif [ "$MODULE_PLAYERBOTS" = "1" ] || [ "$PLAYERBOT_ENABLED" = "1" ]; then
TARGET_PROFILE="playerbots"
echo "🤖 Playerbot profile enabled"
else else
TARGET_PROFILE="standard" TARGET_PROFILE="standard"
echo "✅ No special modules detected - using standard profile" echo "✅ No special modules detected - using standard profile"
@@ -204,12 +207,13 @@ docker compose \
--profile services-standard \ --profile services-standard \
--profile services-playerbots \ --profile services-playerbots \
--profile services-modules \ --profile services-modules \
--profile tools \
--profile client-data \ --profile client-data \
--profile client-data-bots \ --profile client-data-bots \
down 2>/dev/null || true down 2>/dev/null || true
# Build list of profiles to start # Build list of profiles to start
PROFILE_ARGS=(--profile "services-$TARGET_PROFILE" --profile db --profile modules) PROFILE_ARGS=(--profile "services-$TARGET_PROFILE" --profile db --profile modules --profile tools)
case "$TARGET_PROFILE" in case "$TARGET_PROFILE" in
standard) PROFILE_ARGS+=(--profile client-data) ;; standard) PROFILE_ARGS+=(--profile client-data) ;;
playerbots) PROFILE_ARGS+=(--profile client-data-bots) ;; playerbots) PROFILE_ARGS+=(--profile client-data-bots) ;;
@@ -221,12 +225,11 @@ show_staging_step "Realm Activation" "Bringing services online"
echo "🟢 Starting services-$TARGET_PROFILE profile..." echo "🟢 Starting services-$TARGET_PROFILE profile..."
docker compose "${PROFILE_ARGS[@]}" up -d docker compose "${PROFILE_ARGS[@]}" up -d
echo "" printf '\n%b\n' "${GREEN}⚔️ Realm staging completed successfully! ⚔️${NC}"
echo -e "${GREEN}⚔️ Realm staging completed successfully! ⚔️${NC}" printf '%b\n' "${GREEN}🏰 Profile: services-$TARGET_PROFILE${NC}"
echo -e "${GREEN}🏰 Profile: services-$TARGET_PROFILE${NC}" printf '%b\n' "${GREEN}🗡️ Your realm is ready for adventure!${NC}"
echo -e "${GREEN}🗡️ Your realm is ready for adventure!${NC}"
# Show status # Show status
echo "" printf '\n'
echo "📊 Service Status:" echo "📊 Service Status:"
docker compose ps --format "table {{.Name}}\t{{.Status}}\t{{.Ports}}" | grep -E "(ac-worldserver|ac-authserver|NAME)" || true docker compose ps --format "table {{.Name}}\t{{.Status}}\t{{.Ports}}" | grep -E "(ac-worldserver|ac-authserver|ac-phpmyadmin|ac-keira3|NAME)" || true