#!/bin/bash if ! [ -f /.dockerenv ] && ! grep -q 'devices:/docker' /proc/1/cgroup ; then echo "Not running inside docker, exiting to avoid data damage." >&2 exit 1 fi set -e set -u echo "### Starting display server" Xvfb -ac :0 -screen 0 1280x1024x16 & trap 'killall -9 Xvfb' EXIT echo "### Copying and moving files" cp -Rf . /tmp/code ln -s /tmp/node_modules /tmp/code/node_modules cd /tmp/code/ echo "################################################################################" echo "Finished main setup, now running tests ..." npm test echo "### Moving JUnit XML files to /results" mv /tmp/code/t/*.xml /results echo "Finished test execution, test execution returned with exit code." echo "################################################################################"