Skip to content

Commit

Permalink
chore: add drone, docker and dip
Browse files Browse the repository at this point in the history
  • Loading branch information
artofhuman committed Oct 26, 2016
1 parent fa71f99 commit 4408b20
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 26 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-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
- 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
4 changes: 2 additions & 2 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
appraise 'activesupport3.1' do
gem 'activesupport', '~> 3.1.0'
end
end if RUBY_VERSION < '2'

appraise 'activesupport3.2' do
gem 'activesupport', '~> 3.2.0'
end

appraise 'activesupport4.0' do
gem 'activesupport', '~> 4.0.13'
end
end
17 changes: 0 additions & 17 deletions Makefile

This file was deleted.

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

environment:
DOCKER_RUBY_VERSION: 1.9.3
RUBY_IMAGE_TAG: 1.9.3-2
POSTGRES_IMAGE_TAG: 9.3
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

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 config --local https://gems.railsc.ru/ ${APRESS_GEMS_CREDENTIALS}
- dip bundle install
- dip sh mkdir -p gemfiles/.bundle
- dip sh ln -sf ../../.bundle/config /app/gemfiles/.bundle/config
- dip appraisal install
10 changes: 10 additions & 0 deletions docker-compose.development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '2'

services:
app:
volumes:
- bundler_data:/bundle

volumes:
bundler_data:
external: true
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
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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
- ssh_data:/ssh:ro

volumes:
ssh_data:
external: true
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'bundler/setup'
require 'pry-debugger'

require 'simplecov'
SimpleCov.start do
Expand Down
7 changes: 1 addition & 6 deletions treasury.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@ Gem::Specification.new do |spec|

spec.add_runtime_dependency 'rails', '>= 3.1.12', '< 4.1'

spec.add_development_dependency 'bundler', '~> 1.7'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'apress-gems', '>= 0.2'
spec.add_development_dependency 'pry-debugger'

spec.add_development_dependency 'rspec', '>= 3.1'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'combustion', '>= 0.5.3'
spec.add_development_dependency 'appraisal'
end
end

0 comments on commit 4408b20

Please sign in to comment.