You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
967 B

  1. #! /bin/bash
  2. set -eux
  3. # Get the directory of where this script is.
  4. SOURCE="${BASH_SOURCE[0]}"
  5. while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
  6. DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  7. LOGS_DIR="$DIR/logs"
  8. echo
  9. echo "* [$(date +"%T")] cleaning up $LOGS_DIR"
  10. rm -rf "$LOGS_DIR"
  11. mkdir -p "$LOGS_DIR"
  12. set +e
  13. echo
  14. echo "* [$(date +"%T")] removing run_test container"
  15. docker rm -vf run_test
  16. set -e
  17. echo
  18. echo "* [$(date +"%T")] starting rsyslog container"
  19. docker rm -f rsyslog || true
  20. docker run -d -v "$LOGS_DIR:/var/log/" -p 127.0.0.1:5514:514/udp --name rsyslog voxxit/rsyslog
  21. set +u
  22. if [[ "$SKIP_BUILD" == "" ]]; then
  23. echo
  24. echo "* [$(date +"%T")] building docker image"
  25. bash "$DIR/../docker/build.sh"
  26. fi
  27. echo
  28. echo "* [$(date +"%T")] running p2p tests on a local docker network"
  29. bash "$DIR/../p2p/test.sh" tester
  30. echo
  31. echo "* [$(date +"%T")] copying log files out of docker container into $LOGS_DIR"
  32. docker cp rsyslog:/var/log $LOGS_DIR