Building a RESTful Web Service :: Learn how to create a RESTful web service with Spring. :: spring-boot http://spring.io/guides/gs/rest-service/

run.sh 1012B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. cd $(dirname $0)
  2. cd ../initial
  3. mvn clean compile
  4. ret=$?
  5. if [ $ret -ne 0 ]; then
  6. exit $ret
  7. fi
  8. rm -rf target
  9. ./gradlew compileJava
  10. ret=$?
  11. if [ $ret -ne 0 ]; then
  12. exit $ret
  13. fi
  14. rm -rf build
  15. cd ../complete
  16. mvn clean package
  17. java -jar target/gs-rest-service-0.1.0.jar &
  18. PID=$!
  19. sleep 10
  20. curl -s http://localhost:8080/greeting > target/actual.json
  21. kill -9 $PID
  22. echo "Let's look at the actual results: `cat target/actual.json`"
  23. echo "And compare it to: `cat ../test/expected.json`"
  24. if diff -w ../test/expected.json target/actual.json
  25. then
  26. echo SUCCESS
  27. let ret=0
  28. else
  29. echo FAIL
  30. let ret=255
  31. exit $ret
  32. fi
  33. if [ "${TRAVIS_PULL_REQUEST}" = "false" ];
  34. then
  35. curl https://raw.githubusercontent.com/timkay/aws/master/aws -o aws
  36. chmod u+x aws
  37. ./aws put --progress "x-amz-acl: public-read" springio-guides/gs-rest-service-0.1.0.jar target/gs-rest-service-0.1.0.jar
  38. fi
  39. rm -rf target
  40. ./gradlew build
  41. ret=$?
  42. if [ $ret -ne 0 ]; then
  43. exit $ret
  44. fi
  45. rm -rf build
  46. exit