google-auth-library-ruby/.kokoro/build.sh

42 lines
1.2 KiB
Bash
Raw Normal View History

2018-10-09 18:30:25 +00:00
#!/bin/bash
# This file runs tests for merges, PRs, and nightlies.
# There are a few rules for what tests are run:
# * PRs run all non-acceptance tests for every library.
# * Merges run all non-acceptance tests for every library, and acceptance tests for all altered libraries.
# * Nightlies run all acceptance tests for every library.
set -eo pipefail
# Debug: show build environment
env | grep KOKORO
cd github/google-auth-library-ruby/
2019-03-15 05:29:42 +00:00
versions=($RUBY_VERSIONS)
2018-10-09 18:30:25 +00:00
# Temporary workaround for a known bundler+docker issue:
# https://github.com/bundler/bundler/issues/6154
export BUNDLE_GEMFILE=
# Capture failures
EXIT_STATUS=0 # everything passed
function set_failed_status {
EXIT_STATUS=1
}
2019-02-22 18:38:05 +00:00
if [ "$JOB_TYPE" = "release" ]; then
git fetch --depth=10000
2019-03-15 05:29:42 +00:00
python3 -m pip install gcp-releasetool
2019-02-22 18:38:05 +00:00
python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script
(bundle update && bundle exec rake kokoro:release) || set_failed_status
else
2019-03-15 05:29:42 +00:00
for version in "${versions[@]}"; do
2019-02-22 18:38:05 +00:00
rbenv global "$version"
2019-03-15 05:29:42 +00:00
echo "Using Ruby $version"
2019-02-22 18:38:05 +00:00
(bundle update && bundle exec rake) || set_failed_status
done
fi
2018-10-09 18:30:25 +00:00
exit $EXIT_STATUS