feat(CI): prevent PRs that cause DB errors to get on master (#1407)
This commit is contained in:
@@ -44,3 +44,7 @@ install:
|
|||||||
script:
|
script:
|
||||||
# compile
|
# compile
|
||||||
- bash ./acore.sh "compiler" "all"
|
- bash ./acore.sh "compiler" "all"
|
||||||
|
- git clone --depth=1 --branch=master --single-branch https://github.com/ac-data/ac-data.git /home/travis/build/azerothcore/azerothcore-wotlk/env/dist/data
|
||||||
|
- cp ./data/travis/worldserver.conf ./env/dist/etc/worldserver.conf
|
||||||
|
- ./env/dist/bin/worldserver --dry-run
|
||||||
|
- ./apps/ci-error-check.sh
|
||||||
|
|||||||
Executable
+18
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
DB_ERRORS_FILE="/home/travis/build/azerothcore/azerothcore-wotlk/env/dist/bin/DBErrors.log";
|
||||||
|
#DB_ERRORS_FILE="./env/dist/bin/DBErrors.log";
|
||||||
|
|
||||||
|
if [[ ! -f ${DB_ERRORS_FILE} ]]; then
|
||||||
|
echo "File ${DB_ERRORS_FILE} not found!";
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -s ${DB_ERRORS_FILE} ]]; then
|
||||||
|
printf "The DBErrors.log file contains startup errors:\n\n";
|
||||||
|
cat ${DB_ERRORS_FILE};
|
||||||
|
printf "\nPlease solve the startup errors listed above!\n";
|
||||||
|
exit 1;
|
||||||
|
else
|
||||||
|
echo "No startup errors found in DBErrors.log, good job!";
|
||||||
|
fi
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
################################################
|
||||||
|
# AzerothCore World Server configuration file #
|
||||||
|
################################################
|
||||||
|
[worldserver]
|
||||||
|
|
||||||
|
LoginDatabaseInfo = "127.0.0.1;3306;root;;acore_auth"
|
||||||
|
WorldDatabaseInfo = "127.0.0.1;3306;root;;acore_world"
|
||||||
|
CharacterDatabaseInfo = "127.0.0.1;3306;root;;acore_characters"
|
||||||
|
|
||||||
|
EnableLogDB = 1
|
||||||
|
DataDir = "/home/travis/build/azerothcore/azerothcore-wotlk/env/dist/data"
|
||||||
|
LogsDir = "/home/travis/build/azerothcore/azerothcore-wotlk/env/dist/bin"
|
||||||
@@ -46,7 +46,12 @@ public:
|
|||||||
|
|
||||||
std::list<std::string> GetKeysByString(std::string const& name);
|
std::list<std::string> GetKeysByString(std::string const& name);
|
||||||
|
|
||||||
|
bool isDryRun() { return this->dryRun; }
|
||||||
|
void setDryRun(bool mode) { this->dryRun = mode; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool dryRun = false;
|
||||||
|
|
||||||
bool GetValueHelper(const char* name, ACE_TString &result);
|
bool GetValueHelper(const char* name, ACE_TString &result);
|
||||||
bool LoadData(char const* file);
|
bool LoadData(char const* file);
|
||||||
|
|
||||||
|
|||||||
@@ -1350,7 +1350,9 @@ void World::SetInitialWorldSettings()
|
|||||||
///- Init highest guids before any table loading to prevent using not initialized guids in some code.
|
///- Init highest guids before any table loading to prevent using not initialized guids in some code.
|
||||||
sObjectMgr->SetHighestGuids();
|
sObjectMgr->SetHighestGuids();
|
||||||
|
|
||||||
///- Check the existence of the map files for all races' startup areas.
|
if (!sConfigMgr->isDryRun())
|
||||||
|
{
|
||||||
|
///- Check the existence of the map files for all starting areas.
|
||||||
if (!MapManager::ExistMapAndVMap(0, -6240.32f, 331.033f)
|
if (!MapManager::ExistMapAndVMap(0, -6240.32f, 331.033f)
|
||||||
|| !MapManager::ExistMapAndVMap(0, -8949.95f, -132.493f)
|
|| !MapManager::ExistMapAndVMap(0, -8949.95f, -132.493f)
|
||||||
|| !MapManager::ExistMapAndVMap(1, -618.518f, -4251.67f)
|
|| !MapManager::ExistMapAndVMap(1, -618.518f, -4251.67f)
|
||||||
@@ -1363,6 +1365,7 @@ void World::SetInitialWorldSettings()
|
|||||||
{
|
{
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
///- Initialize pool manager
|
///- Initialize pool manager
|
||||||
sPoolMgr->Initialize();
|
sPoolMgr->Initialize();
|
||||||
@@ -1952,6 +1955,11 @@ void World::SetInitialWorldSettings()
|
|||||||
sLog->outString("Enabling database logging...");
|
sLog->outString("Enabling database logging...");
|
||||||
sLog->SetLogDB(true);
|
sLog->SetLogDB(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sConfigMgr->isDryRun()) {
|
||||||
|
sLog->outString("AzerothCore dry run completed, terminating.");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::DetectDBCLang()
|
void World::DetectDBCLang()
|
||||||
|
|||||||
@@ -65,6 +65,11 @@ extern int main(int argc, char** argv)
|
|||||||
int c = 1;
|
int c = 1;
|
||||||
while (c < argc)
|
while (c < argc)
|
||||||
{
|
{
|
||||||
|
if (strcmp(argv[c], "--dry-run") == 0)
|
||||||
|
{
|
||||||
|
sConfigMgr->setDryRun(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (!strcmp(argv[c], "-c"))
|
if (!strcmp(argv[c], "-c"))
|
||||||
{
|
{
|
||||||
if (++c >= argc)
|
if (++c >= argc)
|
||||||
|
|||||||
Reference in New Issue
Block a user