diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-04-09 11:00:49 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-04-09 11:00:49 -0300 |
commit | 8a4bf716002a017de77fe7df301ef8e4aaf00a2e (patch) | |
tree | 4947d0b015baad639fa07133369e9a09c8a468bc /.tools/jobs | |
download | serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.tar.gz serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.tar.bz2 serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.tar.xz serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.zip |
Initial commit
Diffstat (limited to '.tools/jobs')
-rwxr-xr-x | .tools/jobs/build.sh | 15 | ||||
-rwxr-xr-x | .tools/jobs/cloneall.sh | 5 | ||||
-rwxr-xr-x | .tools/jobs/clonedata.sh | 5 | ||||
-rwxr-xr-x | .tools/jobs/initdb.sh | 23 | ||||
-rwxr-xr-x | .tools/jobs/install.sh | 10 | ||||
-rwxr-xr-x | .tools/jobs/newlines.sh | 10 | ||||
-rwxr-xr-x | .tools/jobs/runserver.sh | 38 | ||||
-rwxr-xr-x | .tools/jobs/runservervalgrind.sh | 37 | ||||
-rwxr-xr-x | .tools/jobs/spaces.sh | 10 |
9 files changed, 153 insertions, 0 deletions
diff --git a/.tools/jobs/build.sh b/.tools/jobs/build.sh new file mode 100755 index 00000000..8b57f711 --- /dev/null +++ b/.tools/jobs/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +export LOGFILE=gcc6.log + +source ./.tools/scripts/init.sh + +pwd +cd .. + +build_init + +cd server-code +check_error $? + +make_server "$1" "$2" diff --git a/.tools/jobs/cloneall.sh b/.tools/jobs/cloneall.sh new file mode 100755 index 00000000..79bb8d03 --- /dev/null +++ b/.tools/jobs/cloneall.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +source ./.tools/scripts/init.sh + +do_init diff --git a/.tools/jobs/clonedata.sh b/.tools/jobs/clonedata.sh new file mode 100755 index 00000000..95fa77a5 --- /dev/null +++ b/.tools/jobs/clonedata.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +source ./.tools/scripts/init.sh + +do_init_data diff --git a/.tools/jobs/initdb.sh b/.tools/jobs/initdb.sh new file mode 100755 index 00000000..d6c2480f --- /dev/null +++ b/.tools/jobs/initdb.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +source ./.tools/scripts/init.sh + +cd ../server-data + +export host=$1 +cd sql-files + +export CMD="mysql --force -u root -proot --host=${host}" +check_error $? +echo $CMD <./initremote.sql +$CMD <./initremote.sql +check_error $? + +export CMD="mysql -u evol -pevol --host=${host} evol" +echo Creating tables... +echo $CMD <main.sql +$CMD <main.sql +check_error $? +echo $CMD <logs.sql +$CMD <logs.sql +check_error $? diff --git a/.tools/jobs/install.sh b/.tools/jobs/install.sh new file mode 100755 index 00000000..dd762e1a --- /dev/null +++ b/.tools/jobs/install.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +source ./.tools/scripts/init.sh + +update_repos +aptget_update + +aptget_install $* + +do_init_data diff --git a/.tools/jobs/newlines.sh b/.tools/jobs/newlines.sh new file mode 100755 index 00000000..23309f70 --- /dev/null +++ b/.tools/jobs/newlines.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +find -H . -type f -name "*.txt" -o -name "*.conf" -exec dos2unix {} \; + +export RES=$(git diff --name-only) +if [[ -n "${RES}" ]]; then + echo "Wrong new lines detected in files:" + git diff --name-only + exit 1 +fi diff --git a/.tools/jobs/runserver.sh b/.tools/jobs/runserver.sh new file mode 100755 index 00000000..6bff48ab --- /dev/null +++ b/.tools/jobs/runserver.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +source ./.tools/scripts/init.sh + +function run_server { + echo "running: $1 --run-once $2" + $1 --run-once $2 2>runlog.txt + export errcode=$? + export teststr=$(cat runlog.txt) + if [[ -n "${teststr}" ]]; then + echo "Errors found in running server $1." + cat runlog.txt + echo "Errors found in running server $1." + exit 1 + else + echo "No errors found for server $1." + fi + if [ ${errcode} -ne 0 ]; then + echo "server $1 terminated with exit code ${errcode}" + echo "Test failed" + exit 1 + fi +} + +do_init_tools +init_configs $1 + +cd server-data +pwd +ls -la + +run_server ./login-server +run_server ./char-server + +ARGS="--load-script npc/dev/test.txt " +ARGS="--load-plugin script_mapquit $ARGS --load-script npc/dev/ci_test.txt" + +run_server ./map-server "$ARGS" diff --git a/.tools/jobs/runservervalgrind.sh b/.tools/jobs/runservervalgrind.sh new file mode 100755 index 00000000..6442b091 --- /dev/null +++ b/.tools/jobs/runservervalgrind.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +source ./.tools/scripts/init.sh + +function run_server { + echo "running: $1 --run-once $2" + valgrind -q --read-var-info=yes --track-origins=yes --malloc-fill=11 --free-fill=55 --show-reachable=yes --leak-check=full --leak-resolution=high --partial-loads-ok=yes --error-limit=no $1 --run-once $2 2>runlog.txt + export errcode=$? + export teststr=$(grep "invalid" runlog.txt) + cat runlog.txt + if [[ -n "${teststr}" ]]; then + echo "Errors found in running server $1." + exit 1 + else + echo "No errors found for server $1." + fi + if [ ${errcode} -ne 0 ]; then + echo "server $1 terminated with exit code ${errcode}" + echo "Test failed" + exit 1 + fi +} + +do_init_tools +init_configs $1 + +cd server-data +pwd +ls -la + +run_server ./login-server +run_server ./char-server + +ARGS="--load-script npc/dev/test.txt " +ARGS="--load-plugin script_mapquit $ARGS --load-script npc/dev/ci_test.txt" + +run_server ./map-server "$ARGS" diff --git a/.tools/jobs/spaces.sh b/.tools/jobs/spaces.sh new file mode 100755 index 00000000..b0f485db --- /dev/null +++ b/.tools/jobs/spaces.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +find -H . -type f -name "*.txt" -exec sed -i 's/[[:blank:]]*$//' {} \; + +export RES=$(git diff --name-only) +if [[ -n "${RES}" ]]; then + echo "Extra spaces before new lines detected in files:" + git diff --name-only + exit 1 +fi |