1#!/bin/bash 2# Copyright 2016 gRPC authors. 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. 15set -ex 16 17SYSTEM=$(uname | cut -f 1 -d_) 18 19cd "$(dirname "$0")/../../.." 20set +ex 21[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh 22[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 23set -ex 24 25if [ "$SYSTEM" == "MSYS" ] ; then 26 SYSTEM=MINGW32 27fi 28if [ "$SYSTEM" == "MINGW64" ] ; then 29 SYSTEM=MINGW32 30fi 31 32if [ "$SYSTEM" == "MINGW32" ] ; then 33 echo "Need Linux to build the Windows ruby gem." 34 exit 1 35fi 36 37set +ex 38rvm use default 39gem install bundler --update 40 41tools/run_tests/helper_scripts/bundle_install_wrapper.sh 42 43set -ex 44 45export DOCKERHUB_ORGANIZATION=grpctesting 46rake gem:native 47 48if [ "$SYSTEM" == "Darwin" ] ; then 49 # TODO: consider rewriting this to pass shellcheck 50 # shellcheck disable=SC2046,SC2010 51 rm $(ls pkg/*.gem | grep -v darwin) 52fi 53 54mkdir -p "${ARTIFACTS_OUT}" 55 56cp pkg/*.gem "${ARTIFACTS_OUT}"/ 57