updates project name

This commit is contained in:
uprightbass360
2025-11-08 02:53:38 -05:00
parent 622fd518d2
commit ab80f17a6b
11 changed files with 42 additions and 31 deletions

View File

@@ -1,6 +1,6 @@
# Copy this file to .env and adjust values for your environment. # Copy this file to .env and adjust values for your environment.
# Docker Compose will auto-load .env in the same folder as docker-compose.yml. # Docker Compose will auto-load .env in the same folder as docker-compose.yml.
# Template for acore-compose profiles-based compose # Template for AzerothCore-RealmMaster profiles-based compose
# ===================== # =====================
# Compose overrides (set to 1 to include matching file under compose-overrides/) # Compose overrides (set to 1 to include matching file under compose-overrides/)
@@ -13,7 +13,7 @@ COMPOSE_OVERRIDE_WORLDSERVER_DEBUG_LOGGING_ENABLED=0
# ===================== # =====================
# Project name # Project name
# ===================== # =====================
COMPOSE_PROJECT_NAME=acore-compose COMPOSE_PROJECT_NAME=azerothcore-realmmaster
# ===================== # =====================
# Storage & Timezone # Storage & Timezone
@@ -56,12 +56,12 @@ AC_DB_IMPORT_IMAGE=acore/ac-wotlk-db-import:master
AC_AUTHSERVER_IMAGE=acore/ac-wotlk-authserver:master AC_AUTHSERVER_IMAGE=acore/ac-wotlk-authserver:master
AC_WORLDSERVER_IMAGE=acore/ac-wotlk-worldserver:master AC_WORLDSERVER_IMAGE=acore/ac-wotlk-worldserver:master
# Services (Playerbots) # Services (Playerbots)
AC_AUTHSERVER_IMAGE_PLAYERBOTS=acore-compose:authserver-playerbots AC_AUTHSERVER_IMAGE_PLAYERBOTS=azerothcore-realmmaster:authserver-playerbots
AC_WORLDSERVER_IMAGE_PLAYERBOTS=acore-compose:worldserver-playerbots AC_WORLDSERVER_IMAGE_PLAYERBOTS=azerothcore-realmmaster:worldserver-playerbots
# Services (Module Build Tags) # Services (Module Build Tags)
# Images used during module compilation and tagging # Images used during module compilation and tagging
AC_AUTHSERVER_IMAGE_MODULES=acore-compose:authserver-modules-latest AC_AUTHSERVER_IMAGE_MODULES=azerothcore-realmmaster:authserver-modules-latest
AC_WORLDSERVER_IMAGE_MODULES=acore-compose:worldserver-modules-latest AC_WORLDSERVER_IMAGE_MODULES=azerothcore-realmmaster:worldserver-modules-latest
# Client Data # Client Data
AC_CLIENT_DATA_IMAGE=acore/ac-wotlk-client-data:master AC_CLIENT_DATA_IMAGE=acore/ac-wotlk-client-data:master
AC_CLIENT_DATA_IMAGE_PLAYERBOTS=uprightbass360/azerothcore-wotlk-playerbots:client-data-Playerbot AC_CLIENT_DATA_IMAGE_PLAYERBOTS=uprightbass360/azerothcore-wotlk-playerbots:client-data-Playerbot

View File

@@ -369,13 +369,13 @@ sync_modules(){
} }
resolve_project_name(){ resolve_project_name(){
local raw_name="$(read_env COMPOSE_PROJECT_NAME "acore-compose")" local raw_name="$(read_env COMPOSE_PROJECT_NAME "azerothcore-realmmaster")"
local sanitized local sanitized
sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')" sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')"
sanitized="${sanitized// /-}" sanitized="${sanitized// /-}"
sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')" sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')"
if [[ -z "$sanitized" ]]; then if [[ -z "$sanitized" ]]; then
sanitized="acore-compose" sanitized="azerothcore-realmmaster"
elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then
sanitized="ac${sanitized}" sanitized="ac${sanitized}"
fi fi

View File

@@ -144,14 +144,14 @@ sanitize_project_name(){
sanitized="${sanitized// /-}" sanitized="${sanitized// /-}"
sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')" sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')"
if [[ -z "$sanitized" ]]; then if [[ -z "$sanitized" ]]; then
sanitized="acore-compose" sanitized="azerothcore-realmmaster"
elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then
sanitized="ac${sanitized}" sanitized="ac${sanitized}"
fi fi
echo "$sanitized" echo "$sanitized"
} }
PROJECT_IMAGE_PREFIX="$(sanitize_project_name "${COMPOSE_PROJECT_NAME:-acore-compose}")" PROJECT_IMAGE_PREFIX="$(sanitize_project_name "${COMPOSE_PROJECT_NAME:-azerothcore-realmmaster}")"
remove_storage_dir(){ remove_storage_dir(){
local path="$1" local path="$1"

View File

@@ -58,7 +58,7 @@ show_realm_ready(){
show_remote_plan(){ show_remote_plan(){
local plan_host="${REMOTE_HOST:-<host>}" local plan_host="${REMOTE_HOST:-<host>}"
local plan_user="${REMOTE_USER:-<user>}" local plan_user="${REMOTE_USER:-<user>}"
local plan_dir="${REMOTE_PROJECT_DIR:-~/acore-compose}" local plan_dir="${REMOTE_PROJECT_DIR:-~/AzerothCore-RealmMaster}"
printf '\n%b\n' "${BLUE}🧭 Remote Deployment Plan${NC}" printf '\n%b\n' "${BLUE}🧭 Remote Deployment Plan${NC}"
printf '%b\n' "${YELLOW}├─ Validate build status locally${NC}" printf '%b\n' "${YELLOW}├─ Validate build status locally${NC}"
@@ -138,7 +138,7 @@ collect_remote_details(){
fi fi
if [ -z "$REMOTE_PROJECT_DIR" ]; then if [ -z "$REMOTE_PROJECT_DIR" ]; then
REMOTE_PROJECT_DIR="~/acore-compose" REMOTE_PROJECT_DIR="~/AzerothCore-RealmMaster"
fi fi
if [ "$interactive" -eq 1 ]; then if [ "$interactive" -eq 1 ]; then
local dir_input local dir_input
@@ -182,7 +182,7 @@ validate_remote_configuration(){
fi fi
fi fi
if [ -z "$REMOTE_PROJECT_DIR" ]; then if [ -z "$REMOTE_PROJECT_DIR" ]; then
REMOTE_PROJECT_DIR="~/acore-compose" REMOTE_PROJECT_DIR="~/AzerothCore-RealmMaster"
fi fi
if [ ! -f "$ROOT_DIR/scripts/migrate-stack.sh" ]; then if [ ! -f "$ROOT_DIR/scripts/migrate-stack.sh" ]; then
err "Migration script not found: $ROOT_DIR/scripts/migrate-stack.sh" err "Migration script not found: $ROOT_DIR/scripts/migrate-stack.sh"
@@ -207,7 +207,7 @@ Options:
--remote-user USER SSH username for remote migration --remote-user USER SSH username for remote migration
--remote-port PORT SSH port for remote migration (default: 22) --remote-port PORT SSH port for remote migration (default: 22)
--remote-identity PATH SSH private key for remote migration --remote-identity PATH SSH private key for remote migration
--remote-project-dir DIR Remote project directory (default: ~/acore-compose) --remote-project-dir DIR Remote project directory (default: ~/AzerothCore-RealmMaster)
--remote-skip-storage Skip syncing the storage directory during migration --remote-skip-storage Skip syncing the storage directory during migration
-h, --help Show this help -h, --help Show this help
@@ -347,13 +347,13 @@ ensure_module_state(){
} }
resolve_project_name(){ resolve_project_name(){
local raw_name="$(read_env COMPOSE_PROJECT_NAME "acore-compose")" local raw_name="$(read_env COMPOSE_PROJECT_NAME "azerothcore-realmmaster")"
local sanitized local sanitized
sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')" sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')"
sanitized="${sanitized// /-}" sanitized="${sanitized// /-}"
sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')" sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')"
if [[ -z "$sanitized" ]]; then if [[ -z "$sanitized" ]]; then
sanitized="acore-compose" sanitized="azerothcore-realmmaster"
elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then
sanitized="ac${sanitized}" sanitized="ac${sanitized}"
fi fi
@@ -702,7 +702,7 @@ main(){
show_step 2 "$remote_steps" "Migrating deployment to $REMOTE_HOST" show_step 2 "$remote_steps" "Migrating deployment to $REMOTE_HOST"
if run_remote_migration; then if run_remote_migration; then
ok "Remote deployment package prepared for $REMOTE_USER@$REMOTE_HOST." ok "Remote deployment package prepared for $REMOTE_USER@$REMOTE_HOST."
local remote_dir="${REMOTE_PROJECT_DIR:-~/acore-compose}" local remote_dir="${REMOTE_PROJECT_DIR:-~/AzerothCore-RealmMaster}"
info "Run the following on the remote host to complete deployment:" info "Run the following on the remote host to complete deployment:"
printf ' %bcd %s && ./deploy.sh --yes --no-watch%b\n' "$YELLOW" "$remote_dir" "$NC" printf ' %bcd %s && ./deploy.sh --yes --no-watch%b\n' "$YELLOW" "$remote_dir" "$NC"
exit 0 exit 0

View File

@@ -102,7 +102,7 @@ set -euo pipefail
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)" PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)"
docker compose -f "${PROJECT_DIR}/docker-compose.yml" \ docker compose -f "${PROJECT_DIR}/docker-compose.yml" \
--profile services-standard \ --profile services-standard \
-p "${COMPOSE_PROJECT_NAME:-acore-compose}" up -d --build -p "${COMPOSE_PROJECT_NAME:-azerothcore-realmmaster}" up -d --build
``` ```

View File

@@ -34,12 +34,12 @@ read_env(){
resolve_project_name(){ resolve_project_name(){
local raw_name sanitized local raw_name sanitized
raw_name="$(read_env COMPOSE_PROJECT_NAME "acore-compose")" raw_name="$(read_env COMPOSE_PROJECT_NAME "azerothcore-realmmaster")"
sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')" sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')"
sanitized="${sanitized// /-}" sanitized="${sanitized// /-}"
sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')" sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')"
if [[ -z "$sanitized" ]]; then if [[ -z "$sanitized" ]]; then
sanitized="acore-compose" sanitized="azerothcore-realmmaster"
elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then
sanitized="ac${sanitized}" sanitized="ac${sanitized}"
fi fi

View File

@@ -25,13 +25,13 @@ read_env_value(){
resolve_project_name(){ resolve_project_name(){
local raw_name local raw_name
raw_name="$(read_env_value COMPOSE_PROJECT_NAME "acore-compose")" raw_name="$(read_env_value COMPOSE_PROJECT_NAME "azerothcore-realmmaster")"
local sanitized local sanitized
sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')" sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')"
sanitized="${sanitized// /-}" sanitized="${sanitized// /-}"
sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')" sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')"
if [[ -z "$sanitized" ]]; then if [[ -z "$sanitized" ]]; then
sanitized="acore-compose" sanitized="azerothcore-realmmaster"
elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then
sanitized="ac${sanitized}" sanitized="ac${sanitized}"
fi fi
@@ -79,7 +79,7 @@ Options:
--user USER SSH username on remote host (required) --user USER SSH username on remote host (required)
--port PORT SSH port (default: 22) --port PORT SSH port (default: 22)
--identity PATH SSH private key (passed to scp/ssh) --identity PATH SSH private key (passed to scp/ssh)
--project-dir DIR Remote project directory (default: ~/acore-compose) --project-dir DIR Remote project directory (default: ~/AzerothCore-RealmMaster)
--tarball PATH Output path for the image tar (default: ./local-storage/images/acore-modules-images.tar) --tarball PATH Output path for the image tar (default: ./local-storage/images/acore-modules-images.tar)
--storage PATH Remote storage directory (default: <project-dir>/storage) --storage PATH Remote storage directory (default: <project-dir>/storage)
--skip-storage Do not sync the storage directory --skip-storage Do not sync the storage directory
@@ -120,8 +120,19 @@ if [[ -z "$HOST" || -z "$USER" ]]; then
exit 1 exit 1
fi fi
PROJECT_DIR="${PROJECT_DIR:-/home/${USER}/acore-compose}" expand_remote_path(){
local path="$1"
case "$path" in
"~") echo "/home/${USER}";;
"~/"*) echo "/home/${USER}/${path#~/}";;
*) echo "$path";;
esac
}
PROJECT_DIR="${PROJECT_DIR:-/home/${USER}/AzerothCore-RealmMaster}"
PROJECT_DIR="$(expand_remote_path "$PROJECT_DIR")"
REMOTE_STORAGE="${REMOTE_STORAGE:-${PROJECT_DIR}/storage}" REMOTE_STORAGE="${REMOTE_STORAGE:-${PROJECT_DIR}/storage}"
REMOTE_STORAGE="$(expand_remote_path "$REMOTE_STORAGE")"
LOCAL_STORAGE_ROOT="${STORAGE_PATH_LOCAL:-}" LOCAL_STORAGE_ROOT="${STORAGE_PATH_LOCAL:-}"
if [ -z "$LOCAL_STORAGE_ROOT" ]; then if [ -z "$LOCAL_STORAGE_ROOT" ]; then
LOCAL_STORAGE_ROOT="$(read_env_value STORAGE_PATH_LOCAL "./local-storage")" LOCAL_STORAGE_ROOT="$(read_env_value STORAGE_PATH_LOCAL "./local-storage")"

View File

@@ -98,13 +98,13 @@ ensure_project_image_tag(){
resolve_project_name(){ resolve_project_name(){
local raw_name local raw_name
raw_name="$(read_env COMPOSE_PROJECT_NAME "acore-compose")" raw_name="$(read_env COMPOSE_PROJECT_NAME "azerothcore-realmmaster")"
local sanitized local sanitized
sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')" sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')"
sanitized="${sanitized// /-}" sanitized="${sanitized// /-}"
sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')" sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')"
if [[ -z "$sanitized" ]]; then if [[ -z "$sanitized" ]]; then
sanitized="acore-compose" sanitized="azerothcore-realmmaster"
elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then
sanitized="ac${sanitized}" sanitized="ac${sanitized}"
fi fi

View File

@@ -101,13 +101,13 @@ read_env(){
resolve_project_name(){ resolve_project_name(){
local raw_name local raw_name
raw_name="$(read_env COMPOSE_PROJECT_NAME "acore-compose")" raw_name="$(read_env COMPOSE_PROJECT_NAME "azerothcore-realmmaster")"
local sanitized local sanitized
sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')" sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')"
sanitized="${sanitized// /-}" sanitized="${sanitized// /-}"
sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')" sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')"
if [[ -z "$sanitized" ]]; then if [[ -z "$sanitized" ]]; then
sanitized="acore-compose" sanitized="azerothcore-realmmaster"
elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then
sanitized="ac${sanitized}" sanitized="ac${sanitized}"
fi fi

View File

@@ -51,14 +51,14 @@ resolve_project_name(){
raw_name="$(grep -E '^COMPOSE_PROJECT_NAME=' "$env_path" | tail -n1 | cut -d'=' -f2-)" raw_name="$(grep -E '^COMPOSE_PROJECT_NAME=' "$env_path" | tail -n1 | cut -d'=' -f2-)"
fi fi
if [ -z "$raw_name" ]; then if [ -z "$raw_name" ]; then
raw_name="acore-compose" raw_name="azerothcore-realmmaster"
fi fi
local sanitized local sanitized
sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')" sanitized="$(echo "$raw_name" | tr '[:upper:]' '[:lower:]')"
sanitized="${sanitized// /-}" sanitized="${sanitized// /-}"
sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')" sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')"
if [[ -z "$sanitized" ]]; then if [[ -z "$sanitized" ]]; then
sanitized="acore-compose" sanitized="azerothcore-realmmaster"
elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then
sanitized="ac${sanitized}" sanitized="ac${sanitized}"
fi fi

View File

@@ -50,7 +50,7 @@ sanitize_project_name(){
sanitized="${sanitized// /-}" sanitized="${sanitized// /-}"
sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')" sanitized="$(echo "$sanitized" | tr -cd 'a-z0-9_-')"
if [[ -z "$sanitized" ]]; then if [[ -z "$sanitized" ]]; then
sanitized="acore-compose" sanitized="azerothcore-realmmaster"
elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then elif [[ ! "$sanitized" =~ ^[a-z0-9] ]]; then
sanitized="ac${sanitized}" sanitized="ac${sanitized}"
fi fi