prepare_build_macos_rc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/bash
  2. # Copyright 2017, Google Inc.
  3. # All rights reserved.
  4. #
  5. # Redistribution and use in source and binary forms, with or without
  6. # modification, are permitted provided that the following conditions are
  7. # met:
  8. #
  9. # * Redistributions of source code must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. # * Redistributions in binary form must reproduce the above
  12. # copyright notice, this list of conditions and the following disclaimer
  13. # in the documentation and/or other materials provided with the
  14. # distribution.
  15. # * Neither the name of Google Inc. nor the names of its
  16. # contributors may be used to endorse or promote products derived from
  17. # this software without specific prior written permission.
  18. #
  19. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  22. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  23. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  24. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  25. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  26. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  27. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. # Source this rc script to prepare the environment for macos builds
  31. tools/internal_ci/helper_scripts/gen_report_index.sh
  32. sudo launchctl limit maxfiles unlimited unlimited
  33. # show current maxfiles
  34. launchctl limit maxfiles
  35. ulimit -n 10000
  36. # show current limits
  37. ulimit -a
  38. # Add GCP credentials for BQ access
  39. # pip does not install google-api-python-client properly, so use easy_install
  40. sudo easy_install --upgrade google-api-python-client
  41. export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json
  42. # required to build protobuf
  43. brew install gflags
  44. set +ex # rvm script is very verbose and exits with errorcode
  45. source $HOME/.rvm/scripts/rvm
  46. set -e # rvm commands are very verbose
  47. rvm install ruby-2.4
  48. rvm osx-ssl-certs status all
  49. rvm osx-ssl-certs update all
  50. set -ex
  51. gem install bundler
  52. # cocoapods
  53. export LANG=en_US.UTF-8
  54. gem install cocoapods
  55. gem install xcpretty
  56. pod repo update # needed by python
  57. # python
  58. brew install coreutils # we need grealpath
  59. sudo pip install virtualenv
  60. sudo pip install -U six tox setuptools
  61. # python 3.4
  62. wget -q https://www.python.org/ftp/python/3.4.4/python-3.4.4-macosx10.6.pkg
  63. sudo installer -pkg python-3.4.4-macosx10.6.pkg -target /
  64. # set xcode version for Obj-C tests
  65. sudo xcode-select -switch /Applications/Xcode_8.2.1.app/Contents/Developer
  66. git submodule update --init