Skip to content

Commit

Permalink
chore: add dip & drone
Browse files Browse the repository at this point in the history
  • Loading branch information
deniskorobicyn committed Dec 28, 2016
1 parent 0eb41e7 commit 7cb588c
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 37 deletions.
26 changes: 26 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
matrix:
include:
- DOCKER_RUBY_VERSION: 1.9.3
RUBY_IMAGE_TAG: 1.9.3-2

- DOCKER_RUBY_VERSION: 2.2
RUBY_IMAGE_TAG: 2.2-2

build:
image: abakpress/dind:2
privileged: true
volumes:
- /home/data/drone/images:/images
- /home/data/drone/gems:/bundle
environment:
- COMPOSE_FILE_EXT=drone
commands:
- wrapdocker docker -v

- if [ ! -e /images/ruby_$RUBY_IMAGE_TAG.tar ]; then docker pull abakpress/ruby:$RUBY_IMAGE_TAG; docker save abakpress/ruby:$RUBY_IMAGE_TAG > /images/ruby_$RUBY_IMAGE_TAG.tar; fi

- docker load -i /images/ssh-agent.tar
- docker load -i /images/ruby_$RUBY_IMAGE_TAG.tar

- dip provision
- dip rspec
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
/spec/reports/
/tmp/
gemfiles/
spec/internal/config/database.yml
spec/internal/test_other
spec/internal/test
2 changes: 1 addition & 1 deletion Appraisals
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
appraise 'rails3.1' do
gem 'rails', '~> 3.1.0'
end
end if RUBY_VERSION < '2'

appraise 'rails3.2' do
gem 'rails', '~> 3.2.0'
Expand Down
12 changes: 9 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ source 'https://rubygems.org'

gemspec

if RUBY_VERSION < '2'
gem 'mime-types', '< 3.0'
gem 'json', '< 2.0'
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
31 changes: 0 additions & 31 deletions Makefile

This file was deleted.

45 changes: 45 additions & 0 deletions dip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: '1'

environment:
DOCKER_RUBY_VERSION: 1.9.3
RUBY_IMAGE_TAG: 1.9.3-2
COMPOSE_FILE_EXT: development
RAILS_ENV: test

compose:
files:
- docker-compose.yml
- docker-compose.${COMPOSE_FILE_EXT}.yml

interaction:
sh:
service: app

irb:
service: app
command: irb

bundle:
service: app
command: bundle

rake:
service: app
command: bundle exec rake

appraisal:
service: app
command: bundle exec appraisal

rspec:
service: app
command: bundle exec appraisal bundle exec rspec

clean:
service: app
command: rm -f Gemfile.lock gemfiles/*.gemfile.*

provision:
- docker volume create --name bundler_data
- dip bundle install
- dip appraisal install
14 changes: 14 additions & 0 deletions docker-compose.development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '2'

services:
app:
volumes:
- .:/app
- ../:/localgems
- bundler-data:/bundle

volumes:
bundler-data:
external:
name: bundler_data

8 changes: 8 additions & 0 deletions docker-compose.drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '2'

services:
app:
volumes:
- .:/app
- /bundle:/bundle

10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '2'

services:
app:
image: abakpress/ruby:$RUBY_IMAGE_TAG
environment:
- SSH_AUTH_SOCK=/ssh/auth/sock
- BUNDLE_PATH=/bundle/$DOCKER_RUBY_VERSION
command: bash

1 change: 0 additions & 1 deletion slaver.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rspec-rails'
spec.add_development_dependency 'combustion', '>= 0.5.0', '< 0.5.5'
spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'pry-debugger'
spec.add_development_dependency 'shoulda-matchers', '< 3.0.0'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'database_cleaner'
Expand Down
6 changes: 6 additions & 0 deletions spec/internal/config/database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
test:
adapter: sqlite3
database: test
test_other:
adapter: sqlite3
database: test_other

0 comments on commit 7cb588c

Please sign in to comment.