* Circle CI (#22982) * Build/CI: Add Circle CI * Fix travis (cherry picked from commit cb6439bacd8b5d10ef2a4d2eb4e8ab2f950e4ffd) * CI/CircleCI: Add parallel no-pch build (cherry picked from commit 33c58b4aaf4afc8ca13c1d07c65d66e6beb6bedb) * CI/CircleCI: Use ccache for nopch (cherry picked from commit 6bcf5c64c489175da41acf7739f156319a00f5f9) * CI/CircleCI: Change base docker image to custom-built trinitycore one (cherry picked from commit 37beeb1282c24fc584f5f524279df408779c5d5b) * CI/CircleCI: Switch to Ubuntu 18.10 (cherry picked from commit 6dfb4fde07082498a264ca0802ebdeb0bf3fa994) * CI/CircleCI: Switch to Ubuntu 19.04 (cherry picked from commit 9009c82a8db2bdb433cba17820af8b0cef8e28e3) * CI/Circle CI: Reduce ccache size from 5G to 1G This should speedup Circle CI cache saving and in turn no-pch build (cherry picked from commit 1b543ac16dd61ac6e1f8f00fee28156234c7e73f) * CI/Circle CI: Adjust config for master branch Co-authored-by: Giacomo Pozzoni <[email protected]>
47 lines
1.2 KiB
Bash
47 lines
1.2 KiB
Bash
#!/bin/sh
|
|
name=$1
|
|
branch=$2
|
|
database=$3
|
|
host=$4
|
|
|
|
echo "Database Updater check script:"
|
|
echo " Checking database '${name}' for missing filenames in tables..."
|
|
echo
|
|
|
|
# Select all entries which are in the updates table
|
|
entries=$(mysql -uroot ${database} -h ${host} -e "SELECT name FROM updates" | grep ".sql")
|
|
|
|
cd sql/updates/${name}/${branch}
|
|
|
|
error=0
|
|
updates=0
|
|
|
|
for file in *.sql
|
|
do
|
|
# Check if the given update is in the `updates` table.
|
|
if echo "${entries}" | grep -q "^${file}"; then
|
|
# File is ok
|
|
updates=$((updates+1))
|
|
else
|
|
# The update isn't listed in the updates table of the given database.
|
|
echo "- \"sql/updates/${name}/${file}\" is missing in the '${name}'.'updates' table."
|
|
error=1
|
|
fi
|
|
done
|
|
|
|
if [ ${error} -ne 0 ]
|
|
then
|
|
echo
|
|
echo "Fatal error:"
|
|
echo " The Database Updater is broken for the '${name}' database,"
|
|
echo " because the applied update is missing in the '${name}'.'updates' table."
|
|
echo
|
|
echo "How to fix:"
|
|
echo " Insert the missing names of the already applied sql updates"
|
|
echo " to the 'updates' table of the '${name}' base dump ('sql/base/${name}_database.sql')."
|
|
exit 1
|
|
else
|
|
echo " Everything is OK, finished checking ${updates} updates."
|
|
exit 0
|
|
fi
|