Unverified Commit f7ada128 authored by Paul Yang's avatar Paul Yang Committed by GitHub

Build ruby gem on kokoro (#4819)

* Install rake compiler

* Add kokoro config to build ruby gem on linux

* Rename from linix to linux

* Fix prepare_build.sh name

* Clean up

* Install bundler

* Install bundler

* Use c99 in order to build gem on mingw-32 on ruby 2.0.0

See https://github.com/rake-compiler/rake-compiler-dock/issues/4

* Move c99 config to extcofig.rb
parent 56d27530
#!/bin/bash
set -ex
# change to repo root
cd $(dirname $0)/../../..
source kokoro/release/linux/prepare_build.sh
# ruby environment
source kokoro/release/linux/ruby/ruby_build_environment.sh
# build artifacts
bash kokoro/release/linux/ruby/ruby_build.sh
#!/bin/bash
# Move docker's storage location to scratch disk so we don't run out of space.
echo 'DOCKER_OPTS="${DOCKER_OPTS} --graph=/tmpfs/docker"' | sudo tee --append /etc/default/docker
# Use container registry mirror for pulling docker images (should make downloads faster)
# See https://cloud.google.com/container-registry/docs/using-dockerhub-mirroring
echo 'DOCKER_OPTS="${DOCKER_OPTS} --registry-mirror=https://mirror.gcr.io"' | sudo tee --append /etc/default/docker
sudo service docker restart
# Download Docker images from DockerHub
export DOCKERHUB_ORGANIZATION=grpctesting
# All artifacts come here
mkdir artifacts
export ARTIFACT_DIR=$(pwd)/artifacts
# Configuration for Linux release builds
build_file: "protobuf/kokoro/release/linux/build_artifacts.sh"
action {
define_artifacts {
regex: "github/protobuf/artifacts/**"
}
}
#!/bin/bash
# Build protoc
if test ! -e src/protoc; then
./autogen.sh
./configure
make -j4
fi
umask 0022
pushd ruby
bundle install && bundle exec rake gem:native
ls pkg
mv pkg/* $ARTIFACT_DIR
popd
#!/bin/bash
set +ex
[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
set -e # rvm commands are very verbose
rvm --default use ruby-2.4.1
gem install bundler --update
set -ex
......@@ -7,6 +7,7 @@ source $HOME/.rvm/scripts/rvm
set -e # rvm commands are very verbose
time rvm install 2.5.0
rvm use 2.5.0 --default
gem install rake-compiler --no-ri --no-doc
gem install bundler --no-ri --no-doc
rvm osx-ssl-certs status all
rvm osx-ssl-certs update all
......
......@@ -2,7 +2,9 @@
require 'mkmf'
$CFLAGS += " -std=c99 -O3 -DNDEBUG"
unless RUBY_PLATFORM =~ /mswin|mingw/
$CFLAGS += " -std=c99 -O3 -DNDEBUG"
end
if RUBY_PLATFORM =~ /linux/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment