• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/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
28