run-continuously.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. #
  3. # Sets up and runs the benchmarking suite in an infinite loop. The intent is
  4. # this script would be run by a service such as upstart, restarting if the
  5. # scripts fail.
  6. #
  7. # The following environment variables must
  8. # be set:
  9. # $TFB_REPOPARENT parent folder of the repository
  10. # $TFB_REPONAME name of the repository folder
  11. # $TFB_REPOURI URI for the git repository
  12. # $TFB_MAILINGLIST email address for the mailing list
  13. # $TFB_LOGSFOLDER location to transfer logged output
  14. #
  15. # @author A. Shawn Bandy
  16. #
  17. while true
  18. do
  19. # This file is copied outside the repo and run by tfb service
  20. # so that it may tear down the environment and run without interruption.
  21. # If this file is changed, the tfb service will need to be restarted.
  22. # Now if tasks are updated in the continuous toolset, they will execute
  23. # properly on the next full run.
  24. # Start by tearing down the environment.
  25. # Hold on to the benchmark.cfg it it exists
  26. echo Tearing down and rebuilding the environment
  27. cp $TFB_REPOPARENT/$TFB_REPONAME/benchmark.cfg $TFB_REPOPARENT/benchmark.cfg 2>/dev/null
  28. sudo rm -rf $TFB_REPOPARENT/$TFB_REPONAME
  29. cd $TFB_REPOPARENT
  30. git clone -b $TFB_REPOBRANCH $TFB_REPOURI $TFB_REPOPARENT/$TFB_REPONAME
  31. # Replace the benchmark.cfg
  32. cp $TFB_REPOPARENT/benchmark.cfg $TFB_REPOPARENT/$TFB_REPONAME/benchmark.cfg 2>/dev/null
  33. echo Running continuous tasks
  34. $TFB_REPOPARENT/$TFB_REPONAME/toolset/continuous/tasks/run-tasks.sh
  35. sleep 5
  36. done