mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
## ⚠️ATTENTION! ⚠️ Upgrading procedure: **Database:** After this PR will be merged you need to backup your DB first (you can use the db-assembler or any mysql client to generate the dump) and restore it after. The reason is that we use now docker named volumes instead of binded ones to improve performance. **Conf & client data**: if you use the default configuration, both the etc and the data folder are now available inside the **/env/docker**. Finally, you can cleanup the /docker folder previously used by our system. ## Changes Proposed: This PR will implement the [devcontainer ](https://code.visualstudio.com/docs/remote/containers) feature for VSCode. Allowing us to develop and debug directly within the container in the same way on all OSes. * Implemented support for vscode dev-container feature by remote-extension suite * Docker performance optimizations for MacOS and non-linux hosts * Bash system improvements * Implemented first command using Deno runtime environment (typescript) and [commander.js] * Implemented wait mechanism for db_assembler * Implemented db migration command * possibility to run the authserver and worldserver with GDB using the integrated simple-restarter * Implemented docker multi-stage mechanism to use one single Dockerfile for all the services * client-data downloader now creates a placeholder to avoid downloading the same version of data files multiple times * deployment of pre-compiled docker images on [docker hub](https://hub.docker.com/u/acore), you can test them [here](https://github.com/azerothcore/acore-docker)
120 lines
3.2 KiB
Bash
120 lines
3.2 KiB
Bash
#!/bin/bash
|
|
#
|
|
# * Copyright (C) 2007 - 2015 Hyperweb2 All rights reserved.
|
|
# * GNU General Public License version 3; see www.hyperweb2.com/terms/
|
|
|
|
echo "starting dump process.."
|
|
# check config from same folder and include only if exists
|
|
CONF_FILE=$MT_DIR"/mysql-config"
|
|
if [ -f "$CONF_FILE" ]; then
|
|
source "$CONF_FILE"
|
|
fi;
|
|
|
|
#overwrite configs if file exists and variables are defined
|
|
if [ ! -z "$4" ]; then
|
|
if [ -e "$4" ]; then
|
|
source "$4"
|
|
else # if 4th parameter is not a file, then try to eval
|
|
eval "$4"
|
|
fi;
|
|
fi;
|
|
|
|
source $MT_DIR"/shared-def"
|
|
|
|
if [ ! -z "$1" ]; then
|
|
MYSQL_DB=$1;
|
|
fi
|
|
|
|
#change group instead mod
|
|
#group=`ls -l tables | awk '{print $4}'`
|
|
#if [ $group != "mysql" ]; then
|
|
# if (($CHMODE != 0)); then
|
|
# sudo chgrp -v mysql $TPATH
|
|
# fi
|
|
#fi
|
|
|
|
#change permissions for other users
|
|
if [ ! -z $TPATH ]; then
|
|
if [ ! -d "$TPATH" ]; then
|
|
#create the path recursively
|
|
echo "creating dir: $TPATH.."
|
|
mkdir -p "$TPATH"
|
|
fi
|
|
|
|
if (($CHMODE != 0)); then
|
|
echo "changing permissions.."
|
|
sudo chmod -v o=rwx $TPATH
|
|
fi
|
|
|
|
#clean old tables
|
|
if (($CLEANFOLDER != 0)); then
|
|
rm -rvf $TPATH/*
|
|
fi
|
|
|
|
if [ ! -z "$2" ]; then
|
|
#if tables are specified in parameters then..
|
|
arr=$(echo $2 | tr "," "\n")
|
|
|
|
for T in $arr
|
|
do
|
|
echo "exporting "$T;
|
|
if (($TEXTDUMPS != 1)); then
|
|
FILE="$TPATH/$T.sql"
|
|
if [ -f $FILE ]; then
|
|
rm -f $FILE
|
|
fi
|
|
|
|
if (($PARSEDUMP != 0)); then
|
|
echo "Parsing enabled";
|
|
eval "$MYSQLDUMP$OPTS $DUMPOPTS '$MYSQL_DB' '$T' | $DUMPPARSER > $FILE"
|
|
else
|
|
eval "$MYSQLDUMP$OPTS $DUMPOPTS '$MYSQL_DB' '$T' -r $FILE"
|
|
fi
|
|
else
|
|
echo $(eval "$MYSQLDUMP$OPTS $DUMPOPTS --tab=$TPATH/ '$MYSQL_DB' '$T'")
|
|
fi
|
|
done
|
|
|
|
else
|
|
#else get all tables from selected db
|
|
CMD="$MYSQL$OPTS -N -B -e 'show tables from \`$MYSQL_DB\`'"
|
|
echo "command: "$CMD
|
|
for T in $(eval $CMD)
|
|
do
|
|
if (($TEXTDUMPS != 1)); then
|
|
echo "exporting "$T;
|
|
FILE="$TPATH/$T.sql"
|
|
if [ -f $FILE ]; then
|
|
rm -f $FILE
|
|
fi
|
|
|
|
if (($PARSEDUMP != 0)); then
|
|
echo "Parsing enabled on file "$FILE;
|
|
eval "$MYSQLDUMP$OPTS $DUMPOPTS '$MYSQL_DB' '$T' | $DUMPPARSER > $FILE"
|
|
else
|
|
eval "$MYSQLDUMP$OPTS $DUMPOPTS '$MYSQL_DB' '$T' -r $FILE"
|
|
fi
|
|
else
|
|
echo "exporting "$MYSQL_DB" tables: "$T;
|
|
echo $(eval "$MYSQLDUMP$OPTS $DUMPOPTS --tab=$TPATH/ '$MYSQL_DB' '$T'")
|
|
fi
|
|
done;
|
|
|
|
fi
|
|
fi
|
|
|
|
if [ ! -z "$3" ]; then FULL=$3; fi
|
|
# export full file if option is enabled
|
|
if (($FULL != 0)); then
|
|
echo 'exporting FULL '$MYSQL_DB' in single file';
|
|
rm -f $FPATH
|
|
|
|
if (($PARSEDUMP != 0)); then
|
|
echo "Parsing enabled";
|
|
eval "$MYSQLDUMP$OPTS $DUMPOPTS '$MYSQL_DB' | $DUMPPARSER > $FPATH"
|
|
else
|
|
eval "$MYSQLDUMP$OPTS $DUMPOPTS '$MYSQL_DB' -r $FPATH"
|
|
fi
|
|
fi
|
|
|