blob: 39fd8c1273884f58d87f36d10723b0bbdb27d1f3 [file] [log] [blame]
Paul Yang176bac62017-06-28 15:22:19 -07001#!/bin/bash
2
3# Print usage and fail.
4function 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.
10if [ $0 != ./build_wheel_manylinux.sh ]; then
11 echo "Please run this script from the directory in which it is located." >&2
12 exit 1
13fi
14
15if [ $# -lt 3 ]; then
16 usage
17 exit 1
18fi
19
20PROTOBUF_VERSION=$1
21PYPI_USERNAME=$2
22PYPI_PASSWORD=$3
23
24docker rmi protobuf-python-wheel
25docker build . -t protobuf-python-wheel
26docker run --rm protobuf-python-wheel ./protobuf_optimized_pip.sh $PROTOBUF_VERSION $PYPI_USERNAME $PYPI_PASSWORD
27docker rmi protobuf-python-wheel