aboutsummaryrefslogtreecommitdiff
path: root/python/release/wheel/build_wheel_manylinux.sh
blob: 39fd8c1273884f58d87f36d10723b0bbdb27d1f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

# Print usage and fail.
function usage() {
  echo "Usage: protobuf_optimized_pip.sh PROTOBUF_VERSION PYPI_USERNAME PYPI_PASSWORD" >&2
  exit 1   # Causes caller to exit because we use -e.
}

# Validate arguments.
if [ $0 != ./build_wheel_manylinux.sh ]; then
  echo "Please run this script from the directory in which it is located." >&2
  exit 1
fi

if [ $# -lt 3 ]; then
  usage
  exit 1
fi

PROTOBUF_VERSION=$1
PYPI_USERNAME=$2
PYPI_PASSWORD=$3

docker rmi protobuf-python-wheel
docker build . -t protobuf-python-wheel
docker run --rm protobuf-python-wheel ./protobuf_optimized_pip.sh $PROTOBUF_VERSION $PYPI_USERNAME $PYPI_PASSWORD
docker rmi protobuf-python-wheel