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# shellcheck disable=SC1091 22[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh 23# shellcheck disable=SC1090 24[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 25set -ex 26 27if [ "$SYSTEM" == "MSYS" ] ; then 28 SYSTEM=MINGW32 29fi 30if [ "$SYSTEM" == "MINGW64" ] ; then 31 SYSTEM=MINGW32 32fi 33 34if [ "$SYSTEM" == "MINGW32" ] ; then 35 echo "Need Linux to build the Windows ruby gem." 36 exit 1 37fi 38 39set +ex 40 41# To workaround the problem with bundler 2.1.0 and rubygems-bundler 1.4.5 42# https://github.com/bundler/bundler/issues/7488 43rvm @global 44gem uninstall rubygems-bundler 45 46rvm use default 47gem install bundler -v 1.17.3 48 49tools/run_tests/helper_scripts/bundle_install_wrapper.sh 50 51set -ex 52 53export DOCKERHUB_ORGANIZATION=grpctesting 54rake gem:native 55 56if [ "$SYSTEM" == "Darwin" ] ; then 57 # TODO: consider rewriting this to pass shellcheck 58 # shellcheck disable=SC2046,SC2010 59 rm $(ls pkg/*.gem | grep -v darwin) 60fi 61 62mkdir -p "${ARTIFACTS_OUT}" 63 64cp pkg/*.gem "${ARTIFACTS_OUT}"/ 65