Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 58 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ jobs:
working_directory: ~/intercom-ruby
steps:
- checkout
- run:
name: Route Bundler through the Socket Firewall registry
command: |
set -euo pipefail
if [ -z "${SOCKET_GEM_URL:-}" ]; then
# CircleCI does not share context credentials with forked PRs, so a
# fork cannot be routed. Say so rather than failing the contributor.
if [ -n "${CIRCLE_PR_REPONAME:-}" ]; then
echo "Forked PR: no Socket Firewall credentials available, gems will come from rubygems.org."
exit 0
fi
echo "FATAL: SOCKET_GEM_URL is required (provided by the socket-firewall context)"
exit 1
fi
# Legacy two-argument form: these images ship Bundler 1.x, where
# `bundle config set --global` does not exist and silently no-ops.
bundle config mirror.https://rubygems.org "$SOCKET_GEM_URL"
bundle config mirror.https://rubygems.org | grep -q socket-firewall-registry \
|| { echo "FAIL: bundler mirror not pointing at Socket Firewall"; exit 1; }
- run: bundle install
- run: bundle exec rake
"Test against Ruby 2.5":
Expand All @@ -14,6 +33,21 @@ jobs:
working_directory: ~/intercom-ruby
steps:
- checkout
- run:
name: Route Bundler through the Socket Firewall registry
command: |
set -euo pipefail
if [ -z "${SOCKET_GEM_URL:-}" ]; then
if [ -n "${CIRCLE_PR_REPONAME:-}" ]; then
echo "Forked PR: no Socket Firewall credentials available, gems will come from rubygems.org."
exit 0
fi
echo "FATAL: SOCKET_GEM_URL is required (provided by the socket-firewall context)"
exit 1
fi
bundle config mirror.https://rubygems.org "$SOCKET_GEM_URL"
bundle config mirror.https://rubygems.org | grep -q socket-firewall-registry \
|| { echo "FAIL: bundler mirror not pointing at Socket Firewall"; exit 1; }
- run: bundle install
- run: bundle exec rake
"Test against Ruby 2.6":
Expand All @@ -22,14 +56,34 @@ jobs:
working_directory: ~/intercom-ruby
steps:
- checkout
- run:
name: Route Bundler through the Socket Firewall registry
command: |
set -euo pipefail
if [ -z "${SOCKET_GEM_URL:-}" ]; then
if [ -n "${CIRCLE_PR_REPONAME:-}" ]; then
echo "Forked PR: no Socket Firewall credentials available, gems will come from rubygems.org."
exit 0
fi
echo "FATAL: SOCKET_GEM_URL is required (provided by the socket-firewall context)"
exit 1
fi
bundle config mirror.https://rubygems.org "$SOCKET_GEM_URL"
bundle config mirror.https://rubygems.org | grep -q socket-firewall-registry \
|| { echo "FAIL: bundler mirror not pointing at Socket Firewall"; exit 1; }
- run: bundle install
- run: bundle exec rake

workflows:
version: 2
build_and_test:
jobs:
- "Test against Ruby 2.4"
- "Test against Ruby 2.5"
- "Test against Ruby 2.6"

- "Test against Ruby 2.4":
context:
- socket-firewall
- "Test against Ruby 2.5":
context:
- socket-firewall
- "Test against Ruby 2.6":
context:
- socket-firewall
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source "http://rubygems.org"
source "https://rubygems.org"

gem 'webmock'
gemspec
Expand Down