Debian Codegraph @

tools/internal_ci/helper_scripts/prepare_build_linux_ruby_artifact_rc

raw
1 #!/bin/bash
2 # Copyright 2021 The 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
16 # Source this rc script to load RVM and prepare the ruby environment
17 # for building ruby artifacts.
18
19 # sourcing rvm can generate a failure and we don't want to quit there
20 set +ex
21 # Look for rvm either in /etc/profile.d or in $HOME
22 # shellcheck disable=SC1091
23 [[ -s /etc/profile.d/rvm.sh ]] && source /etc/profile.d/rvm.sh
24 # shellcheck disable=SC1090
25 [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
26
27 # rvm commands are very verbose and we dont want to pollute the log by echo,
28 # but we want to exit if there's a failure
29 set -e
30
31 echo "rvm install ruby-2.5.7"
32 time rvm install ruby-2.5.7
33 echo "rvm --default use ruby-2.5.7"
34 rvm --default use ruby-2.5.7
35
36 # restore the original echo and exit on failure behavior
37 set -ex
38
39 # print current ruby version to log
40 ruby --version
41
42 # Bundler is required for grpc ruby artifact build.
43 gem install bundler -v 1.17.3
44
45 # log gem versions for easier debugging if things go wrong
46 gem list || true