Skip to content

Commit

Permalink
chore: add ruby 2.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarinEA committed Aug 6, 2021
1 parent 01fae58 commit e6b74b6
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 47 deletions.
87 changes: 61 additions & 26 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,73 @@
matrix:
include:
- DOCKER_RUBY_VERSION: 2.2
RUBY_IMAGE_TAG: 2.2-latest
name: build

- DOCKER_RUBY_VERSION: 2.3
RUBY_IMAGE_TAG: 2.3-latest
kind: pipeline
type: docker

build:
test:
image: abakpress/dind-testing
privileged: true
volumes:
- /home/data/drone/images:/images
- /home/data/drone/gems:/bundle
volumes:
- name: rubygems
host:
path: /home/data/drone/rubygems
- name: images
host:
path: /home/data/drone/images
- name: bundle
host:
path: /home/data/drone/gems
- name: rubygems
host:
path: /home/data/drone/rubygems

spec_step_common: &spec_step_common
image: abakpress/dind-testing:1.0.3
pull: if-not-exists
privileged: true
volumes:
- name: images
path: /images
- name: bundle
path: /bundle
commands:
- prepare-build

- fetch-images
--image abakpress/ruby-app:$RUBY_IMAGE_TAG
- dip provision
- dip rspec

steps:
- name: Tests Ruby 2.2
environment:
- COMPOSE_FILE_EXT=drone
- RAILS_ENV=test
- RUBY_IMAGE_TAG=2.2-latest
commands:
- wrapdocker docker -v
COMPOSE_FILE_EXT: drone
DOCKER_RUBY_VERSION: 2.2
RUBY_IMAGE_TAG: 2.2-latest
RAILS_ENV: test
<<: *spec_step_common

- fetch-images
--image abakpress/ruby-app:$RUBY_IMAGE_TAG
- name: Tests Ruby 2.3
environment:
COMPOSE_FILE_EXT: drone
DOCKER_RUBY_VERSION: 2.3
RUBY_IMAGE_TAG: 2.3-latest
RAILS_ENV: test
<<: *spec_step_common

- dip provision
- dip rspec
- name: Tests Ruby 2.4
environment:
COMPOSE_FILE_EXT: drone
DOCKER_RUBY_VERSION: 2.4
RUBY_IMAGE_TAG: 2.4-latest
RAILS_ENV: test
<<: *spec_step_common

release:
image: abakpress/gem-publication
pull: true
- name: release
image: abakpress/gem-publication:latest
pull: if-not-exists
when:
event: push
branch: master
status: success
volumes:
- /home/data/drone/rubygems:/root/.gem
- name: rubygems
path: /root/.gem
commands:
- release-gem --public
13 changes: 5 additions & 8 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
appraise 'rails4.0' do
gem 'rails', '~> 4.0.0'
gem 'sqlite3', '~> 1.3.6'
end

appraise 'rails4.1' do
gem 'rails', '~> 4.1.0'
gem 'sqlite3', '~> 1.3.6'
if RUBY_VERSION < '2.4'
appraise 'rails4.0' do
gem 'rails', '~> 4.0.0'
gem 'sqlite3', '~> 1.3.6'
end
end

appraise 'rails4.2' do
Expand Down
11 changes: 1 addition & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,4 @@ source 'https://rubygems.org'

gemspec

group :test do
if RUBY_VERSION < '2'
gem 'mime-types', '< 3.0'
gem 'json', '< 2.0'
gem 'nokogiri', '< 1.7.0'
else
gem 'test-unit'
gem 'pry-byebug'
end
end
gem 'pry', '< 0.13.0', require: false
5 changes: 3 additions & 2 deletions dip.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: '1'

environment:
DOCKER_RUBY_VERSION: 2.2
RUBY_IMAGE_TAG: 2.2-latest
DOCKER_RUBY_VERSION: 2.4
RUBY_IMAGE_TAG: 2.4-latest
COMPOSE_FILE_EXT: development
RAILS_ENV: test

Expand Down Expand Up @@ -41,5 +41,6 @@ interaction:

provision:
- docker volume create --name bundler_data
- dip clean
- dip bundle install
- dip appraisal install
3 changes: 2 additions & 1 deletion slaver.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec', '~> 3.3'
spec.add_development_dependency 'rspec-rails'
spec.add_development_dependency 'rspec-rails', '~> 3.9.1'
spec.add_development_dependency 'combustion', '>= 0.5.0', '< 0.5.5'
spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'shoulda-matchers', '< 3.0.0'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'database_cleaner'
spec.add_development_dependency 'sqlite3'
spec.add_development_dependency 'pry-byebug'
end

0 comments on commit e6b74b6

Please sign in to comment.