Skip to content

Commit

Permalink
Update Ruby test application and agent Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahramadan committed Jun 10, 2024
1 parent 1566a52 commit 69dc6f7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
runs-on: ubuntu-latest
needs: check-modified-files
# run only if files were modified, the workflow was manually invoked, or doing a release
if: needs.check-modified-files.outputs.files-changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'release' && endsWith(github.ref, '_ruby')
if: needs.check-modified-files.outputs.files-changed == 'true' || github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && endsWith(github.ref, '_ruby'))

steps:
- name: Checkout code
Expand Down
4 changes: 3 additions & 1 deletion src/ruby/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
FROM ruby:latest AS build
WORKDIR /operator-build

ARG AGENT_VERSION

# Install gems from Gemfile into the `workspace` directory
ADD Gemfile .
RUN BUNDLE_PATH=workspace bundle install
Expand All @@ -21,7 +23,7 @@ WORKDIR /operator-build
# Copy the result into a new directory called `/instrumentation`.
RUN sh -c "find 'workspace/ruby/' -type d -name newrelic_rpm\\* -exec cp -r '{}' /instrumentation \\;"

# Adjust permissions of `instrumentation` director to readable by everyone
# Adjust permissions of `instrumentation` directory to readable by everyone
RUN chmod -R go+r /instrumentation

# Clean up build artifacts
Expand Down
2 changes: 1 addition & 1 deletion src/ruby/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

source 'https://rubygems.org'

gem 'newrelic_rpm'
gem *['newrelic_rpm', ENV.fetch('AGENT_VERSION', nil)].compact
16 changes: 0 additions & 16 deletions src/ruby/Gemfile.lock

This file was deleted.

4 changes: 3 additions & 1 deletion tests/ruby/config.ru
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require './app.rb'
require 'bundler'
Bunder.require

require './app.rb'
run Sinatra::Application
2 changes: 1 addition & 1 deletion tests/ruby/start.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

# Start ruby app and provide time to boot Puma
ruby app.rb & sleep 5
bundle exec rackup & sleep 5

# Hit endponint
while true; do
Expand Down

0 comments on commit 69dc6f7

Please sign in to comment.