build.sh 684 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. #
  3. # Build file to set up and run tests
  4. set -ex # exit immediately on error
  5. # Change to repo root
  6. cd $(dirname $0)/../../..
  7. ./tests.sh cpp_distcheck
  8. # Run tests under release docker image.
  9. DOCKER_IMAGE_NAME=protobuf/protoc_$(sha1sum protoc-artifacts/Dockerfile | cut -f1 -d " ")
  10. until docker pull $DOCKER_IMAGE_NAME; do sleep 10; done
  11. docker run -v $(pwd):/var/local/protobuf --rm $DOCKER_IMAGE_NAME \
  12. bash -l /var/local/protobuf/tests.sh cpp || FAILED="true"
  13. # This directory is owned by root. We need to delete it, because otherwise
  14. # Kokoro will attempt to rsync it and fail with a permission error.
  15. rm -rf src/core
  16. if [ "$FAILED" = "true" ]; then
  17. exit 1
  18. fi