Skip to content

Commit

Permalink
Support Rails 7.0. Fixes dejan#180
Browse files Browse the repository at this point in the history
  • Loading branch information
leoarnold committed Jan 2, 2023
1 parent 6374dbe commit 320fa5b
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 24 deletions.
11 changes: 11 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ jobs:
- setup_remote_docker
- run: docker-compose run --rm test-rails-6.1

test_rails_7_0:
docker:
- image: circleci/buildpack-deps
working_directory: ~/project/meta_request
steps:
- checkout:
path: ~/project
- setup_remote_docker
- run: docker-compose run --rm test-rails-7.0

workflows:
version: 2
test_all:
Expand All @@ -92,3 +102,4 @@ workflows:
- test_rails_5_2
- test_rails_6_0
- test_rails_6_1
- test_rails_7_0
6 changes: 3 additions & 3 deletions meta_request/Dockerfile-rails-4.2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apk add --update --no-cache \
RUN mkdir /app /gem
WORKDIR /app

RUN gem install rails -v 4.2.11
RUN gem install rails:4.2.11 activesupport:4.2.11
RUN rails new . --skip-spring

RUN bundle remove sqlite3
Expand All @@ -16,8 +16,8 @@ RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec
RUN gem install /gem/meta_request-*.gem
RUN gem build /gem/meta_request.gemspec -o /gem/meta_request.gem
RUN gem install /gem/meta_request.gem
RUN bundle add meta_request
RUN bundle install --local

Expand Down
4 changes: 2 additions & 2 deletions meta_request/Dockerfile-rails-5.0
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec
RUN gem install /gem/meta_request-*.gem
RUN gem build /gem/meta_request.gemspec -o /gem/meta_request.gem
RUN gem install /gem/meta_request.gem
RUN bundle add meta_request
RUN bundle install --local

Expand Down
4 changes: 2 additions & 2 deletions meta_request/Dockerfile-rails-5.1
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec
RUN gem install /gem/meta_request-*.gem
RUN gem build /gem/meta_request.gemspec -o /gem/meta_request.gem
RUN gem install /gem/meta_request.gem
RUN bundle add meta_request
RUN bundle install --local

Expand Down
16 changes: 12 additions & 4 deletions meta_request/Dockerfile-rails-5.2
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
FROM ruby:2.6-alpine

RUN apk add --update --no-cache \
build-base curl-dev git sqlite-dev \
yaml-dev zlib-dev nodejs yarn tzdata
build-base \
curl-dev \
git \
nodejs \
shared-mime-info \
sqlite-dev \
tzdata \
yaml-dev \
yarn \
zlib-dev

RUN mkdir /app /gem
WORKDIR /app
Expand All @@ -14,8 +22,8 @@ RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec
RUN gem install /gem/meta_request-*.gem
RUN gem build /gem/meta_request.gemspec -o /gem/meta_request.gem
RUN gem install /gem/meta_request.gem
RUN bundle add meta_request
RUN bundle install --local

Expand Down
20 changes: 14 additions & 6 deletions meta_request/Dockerfile-rails-6.0
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
FROM ruby:2.6-alpine

RUN apk add --update --no-cache \
build-base curl-dev git sqlite-dev \
yaml-dev zlib-dev nodejs yarn tzdata
build-base \
curl-dev \
git \
nodejs \
shared-mime-info \
sqlite-dev \
tzdata \
yaml-dev \
yarn \
zlib-dev

RUN mkdir /app /gem
WORKDIR /app

RUN gem install rails -v 6.0.0.rc2
RUN gem install rails -v 6.0.6
RUN rails new .

RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec
RUN gem install /gem/meta_request-*.gem
RUN gem build /gem/meta_request.gemspec -o /gem/meta_request.gem
RUN gem install /gem/meta_request.gem
RUN bundle add meta_request
RUN bundle install --local

Expand All @@ -24,7 +32,7 @@ COPY res/dummy_controller.rb /app/app/controllers/
COPY res/dummy /app/app/views/dummy
COPY res/meta_request_test.rb /app/test/integration/

RUN bundle exec rails db:migrate
RUN bundle exec rails db:migrate webpacker:install

ENV PARALLEL_WORKERS 1

Expand Down
20 changes: 14 additions & 6 deletions meta_request/Dockerfile-rails-6.1
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
FROM ruby:2.6-alpine

RUN apk add --update --no-cache \
build-base curl-dev git sqlite-dev \
yaml-dev zlib-dev nodejs yarn tzdata
build-base \
curl-dev \
git \
nodejs \
shared-mime-info \
sqlite-dev \
tzdata \
yaml-dev \
yarn \
zlib-dev

RUN mkdir /app /gem
WORKDIR /app

RUN gem install rails -v 6.1.0
RUN gem install rails -v 6.1.7
RUN rails new .

RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec
RUN gem install /gem/meta_request-*.gem
RUN gem build /gem/meta_request.gemspec -o /gem/meta_request.gem
RUN gem install /gem/meta_request.gem
RUN bundle add meta_request
RUN bundle install --local

Expand All @@ -24,7 +32,7 @@ COPY res/dummy_controller.rb /app/app/controllers/
COPY res/dummy /app/app/views/dummy
COPY res/meta_request_test.rb /app/test/integration/

RUN bundle exec rails db:migrate
RUN bundle exec rails db:migrate assets:precompile webpacker:install

ENV PARALLEL_WORKERS 1

Expand Down
39 changes: 39 additions & 0 deletions meta_request/Dockerfile-rails-7.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM ruby:3.0-alpine

RUN apk add --update --no-cache \
build-base \
curl-dev \
git \
nodejs \
shared-mime-info \
sqlite-dev \
tzdata \
yaml-dev \
yarn \
zlib-dev

RUN mkdir /app /gem
WORKDIR /app

RUN gem install rails -v 7.0.4
RUN rails new .

RUN bundle install

COPY . /gem

RUN gem build /gem/meta_request.gemspec -o /gem/meta_request.gem
RUN gem install /gem/meta_request.gem
RUN bundle add meta_request
RUN bundle install --local

COPY res/routes.rb /app/config/
COPY res/dummy_controller.rb /app/app/controllers/
COPY res/dummy /app/app/views/dummy
COPY res/meta_request_test.rb /app/test/integration/

RUN bundle exec rails db:migrate

ENV PARALLEL_WORKERS 1

CMD ["bin/rake"]
4 changes: 4 additions & 0 deletions meta_request/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ services:
build:
context: .
dockerfile: Dockerfile-rails-6.1
test-rails-7.0:
build:
context: .
dockerfile: Dockerfile-rails-7.0
2 changes: 1 addition & 1 deletion meta_request/meta_request.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
gem.license = 'MIT'

gem.add_dependency 'rack-contrib', '>= 1.1', '< 3'
gem.add_dependency 'railties', '>= 3.0.0', '< 7'
gem.add_dependency 'railties', '>= 3.0.0', '< 7.1'
gem.add_development_dependency 'rspec', '~> 3.8.0'
gem.add_development_dependency 'rubocop', '~> 0.74.0'

Expand Down

0 comments on commit 320fa5b

Please sign in to comment.