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