Skip to content
Permalink
Browse files

feat(travis-ci): Add support for Minecraft test to travis-ci (#2287)

* feat(travis-ci): add minecraft test

* update MIT Licence date

* feat(travis): depricate travis-ci shellcheck

* removed bash from travis as reverting to trusty

* fix(mcserver): eula now correctly alteres to true

* fix(update): correct mcserver timed loop

* travis-ci now uses ens interface instead of eth

* added internet IP next to query raw
  • Loading branch information...
dgibbs64 committed Apr 9, 2019
1 parent b4eac06 commit 11547a3c82edce6ffcc656f4279e5cb3790bf395
@@ -1,4 +1,4 @@
language: bash node_js
language: node_js
dist: xenial
node_js:
- 10
@@ -40,6 +40,8 @@ jobs:
- # stage name not required
script: bash tests/tests_fctrserver.sh
- # stage name not required
script: bash tests/tests_ts3server.sh
script: bash tests/tests_mcserver.sh
- # stage name not required
script: bash tests/tests_shellcheck.sh
script: bash tests/tests_ts3server.sh
- # retired as codacy does this check.
# script: bash tests/tests_shellcheck.sh
@@ -36,7 +36,7 @@ fn_install_server_files(){
elif [ "${shortname}" == "qw" ]; then
remote_fileurl="https://files.linuxgsm.com/QuakeWorld/nquake.server.linux.083116.full.tar.bz2"; local_filedir="${tmpdir}"; local_filename="nquake.server.linux.083116.full.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="75a409cf08d808f075e4dacdc7b21b78"
elif [ "${shortname}" == "rtcw" ]; then
remote_fileurl="https://files.linuxgsm.com/ReturnToCastleWolfenstein/iortcw-1.51b-x86_64-server-linux-20190208.tar.bz2"; local_filedir="${tmpdir}"; local_filename="iortcw-1.51b-x86_64-server-linux-20190208.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7e555481a3b98e168dfb5e6ddc2fb879"
remote_fileurl="https://files.linuxgsm.com/ReturnToCastleWolfenstein/iortcw-1.51b-x86_64-server-linux-20190208.tar.bz2"; local_filedir="${tmpdir}"; local_filename="iortcw-1.51b-x86_64-server-linux-20190208.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7e555481a3b98e168dfb5e6ddc2fb879"
elif [ "${shortname}" == "ut2k4" ]; then
remote_fileurl="https://files.linuxgsm.com/UnrealTournament2004/ut2004-server-3369-2-ultimate-linux.tar.bz2"; local_filedir="${tmpdir}"; local_filename="ut2004-server-3369-2-ultimate-linux.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="67c5e2cd9c2a4b04f163962ee41eff54"
elif [ "${shortname}" == "ut99" ]; then
@@ -74,16 +74,15 @@ fn_update_minecraft_localbuild(){

if [ -z "${localbuild}" ]; then
# Gives time for var to generate.
end="$(SECONDS+120)"
totalseconds=0
while [ "${SECONDS}" -lt "${end}" ]; do
for seconds in {1..120}; do
fn_print_info "Checking for update: ${remotelocation}: checking local build: waiting for local build: ${totalseconds}"
if [ -z "${loopignore}" ]; then
loopignore=1
fn_script_log_info "Waiting for local build to generate"
fi
localbuild=$(cat "${serverfiles}/logs/latest.log" 2> /dev/null | grep version | grep -Eo '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}")
if [ "${localbuild}" ]; then
if [ "${localbuild}" ]||[ "${seconds}" == "120" ]; then
break
fi
sleep 1
@@ -1,7 +1,7 @@
#!/bin/bash
# Project: Game Server Managers - LinuxGSM
# Author: Daniel Gibbs
# License: MIT License, Copyright (c) 2017 Daniel Gibbs
# License: MIT License, Copyright (c) 2019 Daniel Gibbs
# Purpose: Linux Game Server Management Script
# Contributors: https://linuxgsm.com/contrib
# Documentation: https://docs.linuxgsm.com
@@ -377,4 +377,4 @@ else
getopt=$1
core_getopt.sh
fi
fi
fi
@@ -1,7 +1,7 @@
#!/bin/bash
# Project: Game Server Managers - LinuxGSM
# Author: Daniel Gibbs
# License: MIT License, Copyright (c) 2017 Daniel Gibbs
# License: MIT License, Copyright (c) 2019 Daniel Gibbs
# Purpose: Travis CI Tests: Factorio | Linux Game Server Management Script
# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors
# Documentation: https://docs.linuxgsm.com/
@@ -452,6 +452,14 @@ fn_test_result_fail(){
fi
}

# test result n/a
fn_test_result_na(){
echo "================================="
echo "Expected result: N/A"
echo "Actual result: N/A"
fn_print_fail_nl "TEST N/A"
}

echo "================================="
echo "Travis CI Tests"
echo "Linux Game Server Manager"
@@ -570,7 +578,7 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'

echo ""
echo "2.0 - Instalation"
echo "2.0 - Installation"
echo "=================================================================="

echo ""
@@ -986,4 +994,4 @@ requiredstatus="OFFLINE"
fn_setstatus
fn_print_info "Tidying up directories."
rm -rfv "${serverfiles}"
core_exit.sh
core_exit.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# Project: Game Server Managers - LinuxGSM
# Author: Daniel Gibbs
# License: MIT License, Copyright (c) 2017 Daniel Gibbs
# License: MIT License, Copyright (c) 2019 Daniel Gibbs
# Purpose: Travis CI Tests: Just Cause 2 | Linux Game Server Management Script
# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors
# Documentation: https://docs.linuxgsm.com/
@@ -578,7 +578,7 @@ echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'

echo ""
echo "2.0 - Instalation"
echo "2.0 - Installation"
echo "=================================================================="

echo ""
@@ -904,14 +904,18 @@ echo "================================="
echo "Description:"
echo "Inserting Travis IP in to config."
echo "Allows monitor to work"
travisip=$(ip -o -4 addr|grep eth0|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0)
if [ "$(ip -o -4 addr|grep eth0)" ]; then
travisip=$(ip -o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0)
else
travisip=$(ip -o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0)
fi
sed -i "/BindIP/c\BindIP = \"${travisip}\"," "${serverfiles}/config.lua"
echo "IP: ${travisip}"

echo ""
echo "5.0 - Monitor Tests"
echo "=================================================================="

info_config.sh
echo ""
echo "Server IP - Port: ${ip}:${port}"
echo "Server IP - Query Port: ${ip}:${queryport}"
@@ -1151,4 +1155,4 @@ requiredstatus="OFFLINE"
fn_setstatus
fn_print_info "Tidying up directories."
rm -rfv "${serverfiles}"
core_exit.sh
core_exit.sh

0 comments on commit 11547a3

Please sign in to comment.
You can’t perform that action at this time.