2
0

runall.sh 894 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #! /bin/sh
  2. cleanup() {
  3. find . -name runall.log | xargs rm
  4. }
  5. start_jetty()
  6. {
  7. mvn 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. start_jetty
  25. curl http://localhost:8080/tutorial/
  26. stop_jetty
  27. cd ../contacts
  28. start_jetty
  29. curl http://localhost:8080/contacts/
  30. stop_jetty
  31. cd ../ldap
  32. start_jetty
  33. curl http://localhost:8080/ldap/
  34. stop_jetty
  35. cd ../cas
  36. if [[ -e ./server/cas-server-webapp-3.2.1.war ]]
  37. then
  38. echo "Found cas server war. Running cas sample"
  39. cd server
  40. mvn jetty:run-war &
  41. SERVERPID=$!
  42. cd ../client
  43. start_jetty
  44. curl http://localhost:8080/cas-sample/
  45. kill $SERVERPID
  46. stop_jetty
  47. fi
  48. cleanup