Skip to content

Commit

Permalink
chore: add docker
Browse files Browse the repository at this point in the history
  • Loading branch information
artofhuman committed Jan 30, 2017
1 parent 18aad28 commit c4961e0
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 19 deletions.
30 changes: 30 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
matrix:
include:
- DOCKER_RUBY_VERSION: "2.2"
RUBY_IMAGE_TAG: "2.2-4"

- DOCKER_RUBY_VERSION: "1.9.3"
RUBY_IMAGE_TAG: "1.9.3-4"

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
- RAILS_ENV=test
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
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in resque-integration.gemspec
if RUBY_VERSION < '2'
gem 'json', '< 2'
gem 'rack', '< 2'
gem 'pry-debugger'
else
gem 'pry-byebug'
end

gemspec
15 changes: 0 additions & 15 deletions Makefile

This file was deleted.

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

environment:
DOCKER_RUBY_VERSION: 2.2
RUBY_IMAGE_TAG: 2.2-4
COMPOSE_FILE_EXT: development
RAILS_ENV: test
APRESS_GEMS_CREDENTIALS: ""

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

rspec:
service: app
command: bundle exec rspec

clean:
service: app
command: rm -f Gemfile.lock

provision:
- docker volume create --name bundler_data

- dip bundle config --local https://gems.railsc.ru/ ${APRESS_GEMS_CREDENTIALS}
- dip bundle install
17 changes: 17 additions & 0 deletions docker-compose.development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '2'

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

volumes:
bundler-data:
external:
name: bundler_data

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

services:
app:
volumes:
- /bundle:/bundle
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '2'

services:
app:
image: abakpress/ruby:$RUBY_IMAGE_TAG
environment:
- BUNDLE_PATH=/bundle/$DOCKER_RUBY_VERSION
- SSH_AUTH_SOCK=/ssh/auth/sock
command: bash
volumes:
- .:/app
1 change: 0 additions & 1 deletion resque-integration.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'rspec', '~> 2.14'
gem.add_development_dependency 'simplecov'
gem.add_development_dependency 'mock_redis'
gem.add_development_dependency 'pry-debugger'
gem.add_development_dependency 'timecop'
end
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# coding: utf-8
require 'bundler/setup'
require 'pry-debugger'
require 'rspec'
require 'resque'
require 'simplecov'
Expand Down

0 comments on commit c4961e0

Please sign in to comment.