forked from BAndysc/WoWDatabaseEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase_test.sh
executable file
·79 lines (65 loc) · 2.84 KB
/
database_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
set -e
USER="$3"
PASSWORD="$4"
PORT=$2
HOST="$1"
MYSQL_PATH="$5"
URLs=( 'https://github.com/TrinityCore/TrinityCore' 'https://github.com/TrinityCore/TrinityCore' 'https://github.com/The-Cataclysm-Preservation-Project/TrinityCore' 'https://github.com/azerothcore/azerothcore-wotlk' 'https://github.com/cmangos/wotlk-db' 'https://github.com/cmangos/tbc-db' 'https://github.com/cmangos/classic-db' )
BRANCHEs=( 'master' '3.3.5' 'master' 'master' 'master' 'master' 'master' )
UPDATEs=( 'master' '3.3.5' '4.3.4' '' '' '' '' )
COREs=( 'TrinityMaster' 'TrinityWrath' 'TrinityCata' 'Azeroth' 'CMaNGOS-WoTLK' 'CMaNGOS-TBC' 'CMaNGOS-Classic' )
MANGOSFILEs=( '' '' '' '' 'wotlk' 'tbc' 'classic' )
TYPEs=( 'TC' 'TC' 'TC' 'TC' 'CMANGOS' 'CMANGOS' 'CMANGOS' )
SKIP=( false false false true false false false )
for index in ${!URLs[*]}; do
if ${SKIP[$index]}; then
echo "Skipping ${COREs[$index]}"
continue
fi
"${MYSQL_PATH}" -u ${USER} -p${PASSWORD} -e 'DROP DATABASE IF EXISTS temp_CI'
"${MYSQL_PATH}" -u ${USER} -p${PASSWORD} -e 'CREATE DATABASE temp_CI'
git clone \
-b ${BRANCHEs[$index]} \
--depth 1 \
--filter=blob:none \
--sparse \
${URLs[$index]} Repo \
;
cd Repo
if [ "${TYPEs[$index]}" = "CMANGOS" ]; then
rm -rf ${MANGOSFILEs[$index]}-world-db.zip
rm -rf ${MANGOSFILEs[$index]}mangos.sql
curl -L ${URLs[$index]}/releases/download/latest/${MANGOSFILEs[$index]}-world-db.zip -o ${MANGOSFILEs[$index]}-world-db.zip
7z e ${MANGOSFILEs[$index]}-world-db.zip
rm -rf ${MANGOSFILEs[$index]}-world-db.zip
"${MYSQL_PATH}" -u ${USER} -p${PASSWORD} temp_CI < ${MANGOSFILEs[$index]}mangos.sql
rm -rf ${MANGOSFILEs[$index]}mangos.sql
else
git sparse-checkout set sql/base/dev
git sparse-checkout add sql/updates/world/${UPDATEs[$index]}
git sparse-checkout add data/sql/base/db_world/
git sparse-checkout add data/sql/updates/db_world/
if [ -f "sql/base/dev/world_database.sql" ];
then
"${MYSQL_PATH}" -u ${USER} -p${PASSWORD} temp_CI < sql/base/dev/world_database.sql
for i in sql/updates/world/${UPDATEs[$index]}/*.sql
do
"${MYSQL_PATH}" -u ${USER} -p${PASSWORD} temp_CI < "${i}"
done
else
for i in data/sql/base/db_world/*.sql
do
"${MYSQL_PATH}" -u ${USER} -p${PASSWORD} temp_CI < "${i}"
done
for i in data/sql/updates/db_world/*.sql
do
"${MYSQL_PATH}" -u ${USER} -p${PASSWORD} temp_CI < "${i}"
done
fi
fi
cd ../
dotnet run --project ../DatabaseTester/DatabaseTester.csproj $HOST $PORT $USER $PASSWORD temp_CI x ${COREs[$index]}
"${MYSQL_PATH}" -u ${USER} -p${PASSWORD} -e 'DROP DATABASE temp_CI'
rm -rf Repo
done