tfb-startup.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. echo "running tfb docker image"
  20. docker run \
  21. --network=host \
  22. --mount type=bind,source=$TFB_REPOPARENT/$TFB_REPONAME,target=/FrameworkBenchmarks \
  23. techempower/tfb \
  24. --server-host $TFB_SERVER_HOST \
  25. --client-host $TFB_CLIENT_HOST \
  26. --database-host $TFB_DATABASE_HOST \
  27. --network-mode host \
  28. --results-name "$TFB_RUN_NAME" \
  29. --results-environment "$TFB_ENVIRONMENT" \
  30. --results-upload-uri "$TFB_UPLOAD_URI" \
  31. --quiet
  32. echo "zipping the results"
  33. zip -r results.zip results
  34. echo "uploading the results"
  35. curl \
  36. -i -v \
  37. -X POST \
  38. --header "Content-Type: application/zip" \
  39. --data-binary @results.zip \
  40. $TFB_UPLOAD_URI
  41. echo "done uploading results"