mirror of
https://github.com/uprightbass360/AzerothCore-RealmMaster.git
synced 2026-01-13 09:07:20 +00:00
deployment updates
This commit is contained in:
@@ -2,12 +2,44 @@
|
||||
# ac-compose
|
||||
set -e
|
||||
|
||||
echo "🚀 AzerothCore Auto Post-Install Configuration"
|
||||
echo "=============================================="
|
||||
GREEN='\033[0;32m'; BLUE='\033[0;34m'; NC='\033[0m'
|
||||
|
||||
show_post_install_header(){
|
||||
echo -e "\n${BLUE} ⚔️ REALM POST-INSTALL CONFIGURATION ⚔️${NC}"
|
||||
echo -e "${BLUE} ══════════════════════════════════════════${NC}"
|
||||
echo -e "${BLUE} 🏯 Blessing Your Realm with Final Touches 🏯${NC}\n"
|
||||
}
|
||||
|
||||
show_post_install_header
|
||||
|
||||
# Install required packages
|
||||
apk add --no-cache curl mysql-client bash docker-cli-compose jq || apk add --no-cache curl mysql-client bash jq
|
||||
|
||||
ensure_playerbots_db(){
|
||||
local db_name="${DB_PLAYERBOTS_NAME:-acore_playerbots}"
|
||||
local charset="${MYSQL_CHARACTER_SET:-utf8mb4}"
|
||||
local collation="${MYSQL_COLLATION:-utf8mb4_unicode_ci}"
|
||||
echo "🔐 Ensuring playerbots database '${db_name}' exists..."
|
||||
if mysql -h "${MYSQL_HOST}" -u"${MYSQL_USER}" -p"${MYSQL_ROOT_PASSWORD}" --skip-ssl-verify -e "CREATE DATABASE IF NOT EXISTS \`${db_name}\` CHARACTER SET ${charset} COLLATE ${collation};" >/dev/null 2>&1; then
|
||||
echo "✅ Playerbots database ready"
|
||||
else
|
||||
echo "⚠️ Failed to guarantee playerbots database"
|
||||
fi
|
||||
}
|
||||
|
||||
update_playerbots_conf(){
|
||||
local target="$1"
|
||||
if [ ! -f "$target" ]; then
|
||||
return 0
|
||||
fi
|
||||
if sed -i "s|^PlayerbotsDatabaseInfo *=.*|PlayerbotsDatabaseInfo = \"${MYSQL_HOST};${MYSQL_PORT};${MYSQL_USER};${MYSQL_ROOT_PASSWORD};${DB_PLAYERBOTS_NAME}\"|" "$target"; then
|
||||
echo " 🔁 Updated $(basename "$target")"
|
||||
else
|
||||
echo " ⚠️ Could not update $(basename "$target")"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Create install markers directory
|
||||
mkdir -p /install-markers
|
||||
|
||||
@@ -31,6 +63,7 @@ else
|
||||
for i in $(seq 1 120); do
|
||||
if mysql -h "${MYSQL_HOST}" -u"${MYSQL_USER}" -p"${MYSQL_ROOT_PASSWORD}" --skip-ssl-verify -e "SELECT 1;" >/dev/null 2>&1; then
|
||||
echo "✅ MySQL is ready"
|
||||
ensure_playerbots_db
|
||||
break
|
||||
fi
|
||||
echo " ⏳ Attempt $i/120..."
|
||||
@@ -62,6 +95,10 @@ else
|
||||
sed -i "s|^LoginDatabaseInfo *=.*|LoginDatabaseInfo = \"${MYSQL_HOST};${MYSQL_PORT};${MYSQL_USER};${MYSQL_ROOT_PASSWORD};${DB_AUTH_NAME}\"|" /azerothcore/config/worldserver.conf || true
|
||||
sed -i "s|^WorldDatabaseInfo *=.*|WorldDatabaseInfo = \"${MYSQL_HOST};${MYSQL_PORT};${MYSQL_USER};${MYSQL_ROOT_PASSWORD};${DB_WORLD_NAME}\"|" /azerothcore/config/worldserver.conf || true
|
||||
sed -i "s|^CharacterDatabaseInfo *=.*|CharacterDatabaseInfo = \"${MYSQL_HOST};${MYSQL_PORT};${MYSQL_USER};${MYSQL_ROOT_PASSWORD};${DB_CHARACTERS_NAME}\"|" /azerothcore/config/worldserver.conf || true
|
||||
update_playerbots_conf /azerothcore/config/playerbots.conf
|
||||
update_playerbots_conf /azerothcore/config/playerbots.conf.dist
|
||||
update_playerbots_conf /azerothcore/config/modules/playerbots.conf
|
||||
update_playerbots_conf /azerothcore/config/modules/playerbots.conf.dist
|
||||
|
||||
echo "✅ Configuration files updated"
|
||||
|
||||
@@ -84,7 +121,9 @@ else
|
||||
echo "REALMLIST_UPDATED=true" >> /install-markers/post-install-completed
|
||||
|
||||
echo ""
|
||||
echo "🎉 Auto post-install configuration completed successfully!"
|
||||
echo -e "${GREEN}⚔️ Your realm has been blessed and configured! ⚔️${NC}"
|
||||
echo -e "${GREEN}🏰 All post-installation rituals completed${NC}"
|
||||
echo -e "${GREEN}🗡️ Your realm awaits brave adventurers!${NC}"
|
||||
echo ""
|
||||
tail -f /dev/null
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user