setup_quickstart.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Copyright 2019 Google
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # Script to run in a CI `before_install` phase to setup the quickstart repo
  15. # so that it can be used for integration testing.
  16. set -xeuo pipefail
  17. scripts_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  18. root_dir="$(dirname "$scripts_dir")"
  19. $scripts_dir/setup_bundler.sh
  20. # Source function to check if CI secrets are available.
  21. source $scripts_dir/check_secrets.sh
  22. SAMPLE=$1
  23. # Installations is the only quickstart that doesn't need a real
  24. # GoogleService-Info.plist for its tests.
  25. if check_secrets || [[ ${SAMPLE} == "installations" ]]; then
  26. # Specify repo so the Firebase module and header can be found in a
  27. # development pod install. This is needed for the `pod install` command.
  28. export FIREBASE_POD_REPO_FOR_DEV_POD=`pwd`
  29. git clone https://github.com/firebase/quickstart-ios.git
  30. $scripts_dir/localize_podfile.swift quickstart-ios/"$SAMPLE"/Podfile
  31. cd quickstart-ios/"$SAMPLE"
  32. # To test a branch, uncomment the following line
  33. # git checkout {BRANCH_NAME}
  34. bundle update --bundler
  35. bundle install
  36. bundle exec pod install
  37. # Add GoogleService-Info.plist to Xcode project
  38. ruby ../scripts/info_script.rb "${SAMPLE}"
  39. cd -
  40. fi