tfb-startup.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. set -e
  3. echo "running tfb-shutdown script"
  4. ./tfb-shutdown.sh
  5. echo "removing old tfb directory if necessary"
  6. if [ -d "$TFB_REPOPARENT/$TFB_REPONAME" ]; then
  7. sudo rm -rf $TFB_REPOPARENT/$TFB_REPONAME
  8. fi
  9. echo "cloning tfb repository"
  10. git clone \
  11. -b $TFB_REPOBRANCH \
  12. $TFB_REPOURI \
  13. $TFB_REPOPARENT/$TFB_REPONAME \
  14. --depth 1
  15. echo "moving to tfb directory"
  16. cd $TFB_REPOPARENT/$TFB_REPONAME
  17. echo "building tfb docker image"
  18. docker build -t techempower/tfb \
  19. --build-arg USER_ID=$(id -u) \
  20. --build-arg GROUP_ID=$(id -g) .
  21. echo "running tfb docker image"
  22. docker run \
  23. -e USER_ID=$(id -u) \
  24. --network=host \
  25. --mount type=bind,source=$TFB_REPOPARENT/$TFB_REPONAME,target=/FrameworkBenchmarks \
  26. techempower/tfb \
  27. --server-host $TFB_SERVER_HOST \
  28. --client-host $TFB_CLIENT_HOST \
  29. --database-host $TFB_DATABASE_HOST \
  30. --network-mode host \
  31. --results-name "$TFB_RUN_NAME" \
  32. --results-environment "$TFB_ENVIRONMENT" \
  33. --results-upload-uri "$TFB_UPLOAD_URI" \
  34. --quiet
  35. echo "zipping the results"
  36. zip -r results.zip results
  37. echo "uploading the results"
  38. curl \
  39. -i -v \
  40. -X POST \
  41. --header "Content-Type: application/zip" \
  42. --data-binary @results.zip \
  43. $TFB_UPLOAD_URI
  44. echo "done uploading results"