build-dists.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/bash
  2. # Copyright 2015 Cloudera Inc.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. set -x
  16. # Usage info
  17. show_help() {
  18. cat << EOF
  19. Usage: ${0##*/} [-h] [-a GITHUB_ACCOUNT] GIT_VERSION_TAG
  20. -h display this help and exit
  21. -a GITHUB_ACCOUNT use GITHUB_ACCOUNT instead of 'cloudera'
  22. EOF
  23. }
  24. # Parse command line options
  25. GITHUB_ACCOUNT="cloudera"
  26. GIT_VERSION_TAG=""
  27. OPTIND=1
  28. while getopts ha: opt; do
  29. case $opt in
  30. h)
  31. show_help
  32. exit 0
  33. ;;
  34. a) GITHUB_ACCOUNT=$OPTARG
  35. ;;
  36. *)
  37. show_help >&2
  38. exit 1
  39. ;;
  40. esac
  41. done
  42. shift "$((OPTIND-1))" # Discard the options and sentinel --
  43. GIT_VERSION_TAG="$1"
  44. if [ -z "$GIT_VERSION_TAG" ] || [ "$#" -gt 1 ]; then
  45. show_help >&2
  46. exit 1
  47. fi
  48. # Start build script in manylinux docker container
  49. DOCKER_IMAGE='quay.io/pypa/manylinux1_x86_64'
  50. docker pull "$DOCKER_IMAGE"
  51. docker container run -t --rm -v "$(pwd)/io:/io" "$DOCKER_IMAGE" \
  52. "/io/manylinux/build.sh" \
  53. "/io/pip-dists-build" \
  54. "$GIT_VERSION_TAG" \
  55. "$GITHUB_ACCOUNT"
  56. RETVAL="$?"
  57. if [[ "$RETVAL" != "0" ]]; then
  58. echo "Failed with $RETVAL"
  59. else
  60. echo "Succeeded"
  61. fi
  62. exit $RETVAL