# instead of calling g++ directly you can also use some build toolkit like make
# install the necessary build tools when needed
before_script:
- - apt update && apt -y install libncurses-dev libmodbus-dev libsqlite3-dev libident-dev
+ - apt update && apt -y install libncurses-dev libmodbus-dev libsqlite3-dev libident-dev netcat
script:
- make -C src/
artifacts:
paths:
- dispense
- cokebank_sqlite.so
- - dispsrc
+ - dispsrv
# depending on your build setup it's most likely a good idea to cache outputs to reduce the build time
# cache:
# paths:
cleanup() {
LOG "Killing ${server_pid}"
- kill ${server_pid}
+ kill ${server_pid}; true
}
trap cleanup EXIT
LOG "Server running on PID ${server_pid}"
sleep 1
-echo "" | nc localhost ${PORT}
+# - Make sure that the server started
+if ! (echo "" | nc localhost ${PORT}); then
+ LOG "Server not responding on ${PORT}"
+ LOG "Server log contents:"
+ cat ${BASEDIR}server.log
+fi