build_wheel_manylinux.sh 682 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. # Print usage and fail.
  3. function usage() {
  4. echo "Usage: protobuf_optimized_pip.sh PROTOBUF_VERSION PYPI_USERNAME PYPI_PASSWORD" >&2
  5. exit 1 # Causes caller to exit because we use -e.
  6. }
  7. # Validate arguments.
  8. if [ $0 != ./build_wheel_manylinux.sh ]; then
  9. echo "Please run this script from the directory in which it is located." >&2
  10. exit 1
  11. fi
  12. if [ $# -lt 3 ]; then
  13. usage
  14. exit 1
  15. fi
  16. PROTOBUF_VERSION=$1
  17. PYPI_USERNAME=$2
  18. PYPI_PASSWORD=$3
  19. docker rmi protobuf-python-wheel
  20. docker build . -t protobuf-python-wheel
  21. docker run --rm protobuf-python-wheel ./protobuf_optimized_pip.sh $PROTOBUF_VERSION $PYPI_USERNAME $PYPI_PASSWORD
  22. docker rmi protobuf-python-wheel