Skip to content

Commit

Permalink
chore: rm 1.9 & 3.1 support, add auto release
Browse files Browse the repository at this point in the history
  • Loading branch information
vadshalamov committed Mar 27, 2017
1 parent c6ae751 commit 01bfe56
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 50 deletions.
56 changes: 30 additions & 26 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
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
test:
image: abakpress/dind-testing
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
- RUBY_IMAGE_TAG=2.2-latest
- POSTGRES_IMAGE_TAG=9.3-latest
- REDIS_IMAGE_TAG=3-alpine
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
- fetch-images
--image whilp/ssh-agent
--image abakpress/ruby-app:$RUBY_IMAGE_TAG
--image abakpress/postgres-db:$POSTGRES_IMAGE_TAG
--image redis:$REDIS_IMAGE_TAG

- 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

- dip ssh add -T -v /ssh_keys -k /ssh_keys/id_rsa
- dip provision
- dip rspec
release:
image: abakpress/gem-publication
pull: true
when:
event: push
commands:
- release-gem
4 changes: 0 additions & 4 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
appraise 'activesupport3.1' do
gem 'activesupport', '~> 3.1.0'
end if RUBY_VERSION < '2'

appraise 'activesupport3.2' do
gem 'activesupport', '~> 3.2.0'
end
12 changes: 0 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,5 @@ source 'https://gems.railsc.ru/'
source 'https://rubygems.org'

# Specify your gem's dependencies in treasury.gemspec
if RUBY_VERSION < '2'
gem 'mime-types', '< 3.0'
gem 'json', '< 2'
gem 'pry-debugger'
gem 'pg', '<= 0.18.4'
gem 'shoulda-matchers', '< 3.0.0'
gem 'nokogiri', '< 1.7.0'
gem 'public_suffix', '< 1.5.0'
else
gem 'pry-byebug'
gem 'test-unit'
end

gemspec
10 changes: 5 additions & 5 deletions dip.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
version: '1'

environment:
DOCKER_RUBY_VERSION: 1.9.3
RUBY_IMAGE_TAG: 1.9.3-2
POSTGRES_IMAGE_TAG: 9.3
DOCKER_RUBY_VERSION: 2.2
RUBY_IMAGE_TAG: 2.2-latest
POSTGRES_IMAGE_TAG: 9.3-latest
REDIS_IMAGE_TAG: 3-alpine
COMPOSE_FILE_EXT: development
RAILS_ENV: test
APRESS_GEMS_CREDENTIALS: ""
Expand Down Expand Up @@ -36,7 +37,6 @@ interaction:
provision:
- docker volume create --name bundler_data
- dip bundle config --local https://gems.railsc.ru/ ${APRESS_GEMS_CREDENTIALS}
- dip clean
- dip bundle install
- dip sh mkdir -p gemfiles/.bundle
- dip sh ln -sf ../../.bundle/config /app/gemfiles/.bundle/config
- dip appraisal install
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '2'

services:
app:
image: abakpress/ruby:$RUBY_IMAGE_TAG
image: abakpress/ruby-app:$RUBY_IMAGE_TAG
environment:
- BUNDLE_PATH=/bundle/$DOCKER_RUBY_VERSION
- SSH_AUTH_SOCK=/ssh/auth/sock
Expand All @@ -18,12 +18,12 @@ services:
- ssh_data:/ssh:ro

db:
image: abakpress/postgres:$POSTGRES_IMAGE_TAG
image: abakpress/postgres-db:$POSTGRES_IMAGE_TAG
environment:
- POSTGRES_DB=docker

redis:
image: redis:3-alpine
image: redis:$REDIS_IMAGE_TAG
command: 'redis-server --appendonly yes --bind 0.0.0.0'

volumes:
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require 'combustion'
require "factory_girl_rails"
require 'shoulda-matchers'
require 'pry-byebug'

SimpleCov.start do
minimum_coverage 73.5
Expand Down
4 changes: 4 additions & 0 deletions treasury.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = %w(lib)

spec.metadata['allowed_push_host'] = 'https://gems.railsc.ru'

spec.add_runtime_dependency 'rails', '>= 3.1.12', '< 4.1'
spec.add_runtime_dependency 'daemons', '>= 1.1.9'
spec.add_runtime_dependency 'class_logger', '>= 1.0.1'
Expand All @@ -35,4 +37,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'rspec-given'
spec.add_development_dependency 'shoulda-matchers'
spec.add_development_dependency 'test-unit'
spec.add_development_dependency 'pry-byebug'
end

0 comments on commit 01bfe56

Please sign in to comment.