runall.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #! /bin/sh
  2. cleanup() {
  3. find . -name runall.log | xargs rm
  4. }
  5. start_jetty()
  6. {
  7. mvn -o jetty:run > runall.log &
  8. until (grep "Started Jetty Server" runall.log)
  9. do
  10. echo "Waiting for server to start..."
  11. sleep 3
  12. done
  13. }
  14. stop_jetty() {
  15. kill $!
  16. until (grep "Jetty server exiting" runall.log)
  17. do
  18. echo "Waiting for server to stop..."
  19. sleep 2
  20. done
  21. }
  22. cleanup
  23. cd tutorial
  24. echo "Running tutorial app..."
  25. start_jetty
  26. curl http://localhost:8080/tutorial/
  27. stop_jetty
  28. echo "Running contacts app..."
  29. cd ../contacts
  30. start_jetty
  31. curl http://localhost:8080/contacts/
  32. stop_jetty
  33. echo "Running ldap app..."
  34. cd ../ldap
  35. start_jetty
  36. curl http://localhost:8080/ldap/
  37. stop_jetty
  38. echo "Running preauth app..."
  39. cd ../preauth
  40. start_jetty
  41. curl http://localhost:8080/preauth/
  42. stop_jetty
  43. cd ../cas
  44. if [[ -e ./server/cas-server-webapp-3.3.1.war ]]
  45. then
  46. echo "Found cas server war. Running cas sample"
  47. cd server
  48. mvn jetty:run-war &
  49. SERVERPID=$!
  50. cd ../client
  51. start_jetty
  52. curl http://localhost:8080/cas-sample/
  53. kill $SERVERPID
  54. stop_jetty
  55. fi
  56. cleanup