bitbucket-pipelines-dependencies.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2020 Embedded AMS B.V. - All Rights Reserved
  4. #
  5. # This file is part of Embedded Proto.
  6. #
  7. # Embedded Proto is open source software: you can redistribute it and/or
  8. # modify it under the terms of the GNU General Public License as published
  9. # by the Free Software Foundation, version 3 of the license.
  10. #
  11. # Embedded Proto is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with Embedded Proto. If not, see <https://www.gnu.org/licenses/>.
  18. #
  19. # For commercial and closed source application please visit:
  20. # <https://EmbeddedProto.com/license/>.
  21. #
  22. # Embedded AMS B.V.
  23. # Info:
  24. # info at EmbeddedProto dot com
  25. #
  26. # Postal address:
  27. # Johan Huizingalaan 763a
  28. # 1066 VH, Amsterdam
  29. # the Netherlands
  30. #
  31. if [ -d "$PWD/protoc" ]; then
  32. echo "found protoc cache"
  33. else
  34. curl --insecure -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.11.0/protoc-3.11.0-linux-x86_64.zip
  35. unzip -o protoc-3*.zip -d protoc/
  36. fi
  37. export PATH="$PATH:$PWD/protoc/bin"
  38. if [ -d "$PWD/build-wrapper" ]; then
  39. echo "found sonar cloud wrapper cache"
  40. else
  41. curl --insecure -OL https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
  42. unzip -o build-wrapper-linux-x86.zip
  43. mv build-wrapper-linux-x86/ build-wrapper/
  44. # The following is required for my local machine.
  45. cp build-wrapper/libinterceptor-x86_64.so build-wrapper/libinterceptor-haswell.so
  46. fi
  47. export PATH="$PATH:$PWD/build-wrapper"
  48. if [ -d "$PWD/sonar-scanner/" ]; then
  49. echo "found sonar scanner scanner cache"
  50. else
  51. curl --insecure -OL https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873-linux.zip
  52. unzip -o sonar-scanner-cli-*-linux.zip
  53. mv sonar-scanner*/ sonar-scanner/
  54. fi
  55. export PATH="$PATH:$PWD/sonar-scanner/bin"
  56. if [ -d "$PWD/venv" ]; then
  57. echo "found python virtualenv in cache"
  58. else
  59. ./setup.sh
  60. fi