build 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/bash
  2. echo "[0/7] Building..."
  3. if ! [ -d "doorgo" ]; then
  4. echo "[1/7] Cloning doorgo library"
  5. git clone https://git.red-green.com/RedGreen/doorgo --depth 1
  6. else
  7. echo "[1/7] Updating doorgo library"
  8. cd doorgo
  9. git pull --no-rebase
  10. cd ..
  11. fi
  12. if ! [ -d ".bin" ]; then
  13. echo "[2/7] Making binary directory"
  14. mkdir .bin
  15. else
  16. echo "[2/7] Cleaning binary directory"
  17. rm -rf .bin
  18. mkdir .bin
  19. fi
  20. if ! [ -d "Server" ]; then
  21. echo "[3/7] Missing server codebase"
  22. echo "Please try 'git pull' or report this https://git.red-green.com/david/Core/issues/new"
  23. exit -1
  24. else
  25. echo "[3/7] Found server codebase"
  26. fi
  27. if ! [ -d "Client" ]; then
  28. echo "[4/7] Missing client codebase"
  29. echo "Please try 'git pull' or report this https://git.red-green.com/david/Core/issues/new"
  30. exit -1
  31. else
  32. echo "[4/7] Found client codebase"
  33. fi
  34. echo "[5/7] Building server..."
  35. cd Server
  36. go build
  37. if ! [ -f "core-server" ]; then
  38. echo "[5/7] Failed"
  39. echo "Please report this https://git.red-green.com/david/Core/issues/new"
  40. exit -1
  41. else
  42. echo "[5/7] Ok"
  43. mv core-server ../.bin/core-server
  44. cd ..
  45. fi
  46. echo "[6/7] Building client..."
  47. cd Client
  48. go build
  49. if ! [ -f "core-client" ]; then
  50. echo "[6/7] Failed"
  51. echo "Please report this https://git.red-green.com/david/Core/issues/new"
  52. exit -1
  53. else
  54. echo "[6/7] Ok"
  55. mv core-client ../.bin/core-client
  56. cd ..
  57. fi
  58. echo "[7/7] Done"