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