summaryrefslogtreecommitdiff
path: root/.tools/jobs
diff options
context:
space:
mode:
authorSaulc <lucashelaine14@gmail.com>2018-01-13 20:50:42 +0100
committerSaulc <lucashelaine14@gmail.com>2018-01-13 20:50:42 +0100
commit20df2abc1aca00d6aa5dc78347133890f36b32f3 (patch)
tree4ad4a8bb8b0605473a702e314799a4626347721a /.tools/jobs
downloadserverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.gz
serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.bz2
serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.xz
serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.zip
Initial commit
Diffstat (limited to '.tools/jobs')
-rwxr-xr-x.tools/jobs/build.sh15
-rwxr-xr-x.tools/jobs/cloneall.sh5
-rwxr-xr-x.tools/jobs/clonedata.sh5
-rwxr-xr-x.tools/jobs/initdb.sh23
-rwxr-xr-x.tools/jobs/install.sh10
-rwxr-xr-x.tools/jobs/runserver.sh38
-rwxr-xr-x.tools/jobs/runservervalgrind.sh37
7 files changed, 133 insertions, 0 deletions
diff --git a/.tools/jobs/build.sh b/.tools/jobs/build.sh
new file mode 100755
index 000000000..8b57f711f
--- /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 000000000..79bb8d039
--- /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 000000000..95fa77a57
--- /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 000000000..d6c2480fb
--- /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 000000000..dd762e1a4
--- /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/runserver.sh b/.tools/jobs/runserver.sh
new file mode 100755
index 000000000..6bff48ab1
--- /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 000000000..6442b0913
--- /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"