Skip to content

Commit

Permalink
chore: add drone and dip
Browse files Browse the repository at this point in the history
  • Loading branch information
Le6ow5k1 committed Nov 9, 2016
1 parent 27502f5 commit 90bf503
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
matrix:
include:
- DOCKER_RUBY_VERSION: 2.2
RUBY_IMAGE_TAG: 2.2-1

- DOCKER_RUBY_VERSION: 1.9.3
RUBY_IMAGE_TAG: 1.9.3-2

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

- if [ ! -e /images/ssh-agent.tar ]; then docker pull whilp/ssh-agent; docker save whilp/ssh-agent > /images/ssh-agent.tar; fi
- 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 ssh add -T -v /ssh_keys -k /ssh_keys/id_rsa
- dip provision
- dip rspec
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in string_tools.gemspec
gemspec

if RUBY_VERSION < '2'
gem 'activerecord', '< 5.0'
gem 'actionpack', '< 5.0'
gem 'activesupport', '< 5.0'
gem 'pry-debugger'
else
gem 'pry-byebug'
end
41 changes: 41 additions & 0 deletions dip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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

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
18 changes: 18 additions & 0 deletions docker-compose.development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '2'

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

volumes:
bundler-data:
external:
name: bundler_data

ssh-data:
external:
name: ssh_data
13 changes: 13 additions & 0 deletions docker-compose.drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '2'

services:
app:
volumes:
- .:/app
- /bundle:/bundle
- ssh-data:/ssh:ro

volumes:
ssh-data:
external:
name: ssh_data
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
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 string_tools.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'appraisal', '>= 1.0.2'
spec.add_development_dependency 'combustion', '>= 0.5.3'
spec.add_development_dependency 'simplecov', '>= 0.9'
spec.add_development_dependency 'pry-debugger'
end

0 comments on commit 90bf503

Please sign in to comment.