SETUP 925 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/sh
  2. echo "0. Ensure that protoc is installed."
  3. if which protoc; then
  4. echo "OK"
  5. else
  6. echo "Please install protoc and be sure that it is in your search path."
  7. exit
  8. fi
  9. echo "1. Set gopath and search path"
  10. export GOPATH=`pwd`/go
  11. export PATH=$GOPATH/bin:$PATH
  12. echo "2. Get the Go plugin for protoc"
  13. go get -a github.com/golang/protobuf/protoc-gen-go
  14. echo "3. Run protoc to generate the service API code"
  15. mkdir -p go/src/echo
  16. protoc ../echo.proto --proto_path=.. --go_out=plugins=grpc:go/src/echo
  17. echo "4. Get the server and client dependencies"
  18. go get server
  19. go get client
  20. echo "5. Build the server and client"
  21. go build server
  22. go build client
  23. echo "6. Stop any previously-running instances of the server"
  24. killall server
  25. echo "7. Start the server"
  26. ./server &
  27. echo "8. Run the client"
  28. sleep 1 # give the server some time to start
  29. ./client -m "Remember the milk."
  30. ./client -m "Testing" -n 3 -update