Skip to content

Commit

Permalink
Add Rails 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lloeki committed Mar 20, 2024
1 parent cc37152 commit 9e0e018
Show file tree
Hide file tree
Showing 82 changed files with 1,995 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/run-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ jobs:
weblog: rails61
- library: ruby
weblog: rails70
- library: ruby
weblog: rails71
version:
- prod
- dev
Expand Down
26 changes: 26 additions & 0 deletions utils/build/docker/ruby/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# System test apps for Ruby

## Updating lockfiles


```
# example with rails71
# get base image to use same ruby version
cat rails71.Dockerfile | perl -ne '/^FROM (.*)/ and print "$1\n"'
# go into app
cd rails71
# conservative lock update (like bundle install)
docker run --rm -it -v "${PWD}":"${PWD}" -w "${PWD}" ghcr.io/datadog/dd-trace-rb/ruby:3.2.0-dd bundle lock
# full lock update (like bundle update)
docker run --rm -it -v "${PWD}":"${PWD}" -w "${PWD}" ghcr.io/datadog/dd-trace-rb/ruby:3.2.0-dd bundle lock --update
# adding a target platform with same deps as local platform
docker run --rm -it -v "${PWD}":"${PWD}" -w "${PWD}" ghcr.io/datadog/dd-trace-rb/ruby:3.2.0-dd bundle lock --add-platform x86_64-linux-gnu
docker run --rm -it -v "${PWD}":"${PWD}" -w "${PWD}" ghcr.io/datadog/dd-trace-rb/ruby:3.2.0-dd bundle lock --add-platform aarch64-linux-gnu
docker run --rm -it -v "${PWD}":"${PWD}" -w "${PWD}" ghcr.io/datadog/dd-trace-rb/ruby:3.2.0-dd bundle lock --add-platform x86_64-darwin
docker run --rm -it -v "${PWD}":"${PWD}" -w "${PWD}" ghcr.io/datadog/dd-trace-rb/ruby:3.2.0-dd bundle lock --add-platform arm64-darwin
```
19 changes: 19 additions & 0 deletions utils/build/docker/ruby/rails71.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ghcr.io/datadog/dd-trace-rb/ruby:3.2.0-dd

RUN apt-get update && apt-get install -y nodejs npm

RUN mkdir -p /app
WORKDIR /app

COPY utils/build/docker/ruby/rails71/ .
COPY utils/build/docker/ruby/install_ddtrace.sh binaries* /binaries/
RUN /binaries/install_ddtrace.sh

ENV DD_TRACE_HEADER_TAGS=user-agent
ENV RAILS_ENV=production
ENV RAILS_MASTER_KEY=9d319c57ec128e905d9e2ce5742bf2de
RUN bundle exec rails db:create db:migrate db:seed

RUN echo "#!/bin/bash\nbundle exec puma -b tcp://0.0.0.0 -p 7777 -w 1" > app.sh
RUN chmod +x app.sh
CMD [ "./app.sh" ]
4 changes: 4 additions & 0 deletions utils/build/docker/ruby/rails71/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.envrc
shell.nix
vendor/bundle
node_modules
7 changes: 7 additions & 0 deletions utils/build/docker/ruby/rails71/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.

# Mark the database schema as having been generated.
db/schema.rb linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
39 changes: 39 additions & 0 deletions utils/build/docker/ruby/rails71/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-*

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore uploaded files in development.
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

/public/assets

# Ignore master key for decrypting credentials and more.
/config/master.key

.envrc
shell.nix
/vendor/bundle
1 change: 1 addition & 0 deletions utils/build/docker/ruby/rails71/.ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-3.0.2
80 changes: 80 additions & 0 deletions utils/build/docker/ruby/rails71/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "~> 3.2.0"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.1.1"

# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem "sprockets-rails"

# Use sqlite3 as the database for Active Record
gem "sqlite3", "~> 1.4"

# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 6.0"

# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem "importmap-rails"

# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem "turbo-rails"

# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem "stimulus-rails"

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem "jbuilder"

# Talk with Kafka for propagation tests
gem "ruby-kafka"

# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"

# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false

# Use Sass to process CSS
# gem "sassc-rails"

# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
end

group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"

# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem "rack-mini-profiler"

# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end

group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara"
gem "selenium-webdriver"
gem "webdrivers"
end

gem 'devise'

gem 'pry'
gem 'ddtrace', '~> 1.0.0.a', require: 'ddtrace/auto_instrument'
Loading

0 comments on commit 9e0e018

Please sign in to comment.