-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
paperclip v5.0 требует rails >= v4.2 и aws-sdk > v2
- Loading branch information
Showing
14 changed files
with
167 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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:1 | ||
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 | ||
- POSTGRES_IMAGE_TAG=9.3 | ||
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 | ||
- if [ ! -e /images/postgres_$POSTGRES_IMAGE_TAG.tar ]; then docker pull abakpress/postgres:$POSTGRES_IMAGE_TAG; docker save abakpress/postgres:$POSTGRES_IMAGE_TAG > /images/postgres_$POSTGRES_IMAGE_TAG.tar; fi | ||
|
||
- docker load -i /images/ssh-agent.tar | ||
- docker load -i /images/ruby_$RUBY_IMAGE_TAG.tar | ||
- docker load -i /images/postgres_$POSTGRES_IMAGE_TAG.tar | ||
|
||
- dip ssh add -T -v /ssh_keys -k /ssh_keys/id_rsa | ||
- dip provision | ||
- dip rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
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 | ||
|
||
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 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
ssh-data: | ||
external: | ||
name: ssh_data | ||
|
||
bundler-data: | ||
external: | ||
name: bundler_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '2' | ||
|
||
services: | ||
app: | ||
image: abakpress/ruby:$RUBY_IMAGE_TAG | ||
environment: | ||
- BUNDLE_PATH=/bundle/$DOCKER_RUBY_VERSION | ||
- SSH_AUTH_SOCK=/ssh/auth/sock | ||
- TEST_DB_HOST=db | ||
- TEST_DB_NAME=docker | ||
- TEST_DB_USERNAME=postgres | ||
command: bash | ||
depends_on: | ||
- db | ||
|
||
db: | ||
image: abakpress/postgres:$POSTGRES_IMAGE_TAG | ||
environment: | ||
- POSTGRES_DB=docker |
17 changes: 17 additions & 0 deletions
17
spec/helpers/apress/amazon_assets/amazon_assets_helper_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# coding: utf-8 | ||
require 'spec_helper' | ||
|
||
RSpec.describe Apress::AmazonAssets::AmazonAssetsHelper, type: :helper do | ||
describe '#attachments_fields' do | ||
let(:form) { double(ActionView::Helpers::FormBuilder) } | ||
|
||
let(:options) { {attachments: [], max_size: 0, max_count: 0, attach_to: nil, permitted_type: []} } | ||
|
||
it do | ||
expect(helper).to receive(:render).with( | ||
described_class::DEFAULT_ATTACHMENT_FIELDS_PATH, form: form, options: options | ||
) | ||
helper.attachments_fields(form, options) | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
test: | ||
adapter: postgresql | ||
host: <%= ENV.fetch("TEST_DB_HOST", "localhost") %> | ||
database: <%= ENV.fetch("TEST_DB_NAME", "docker") %> | ||
username: <%= ENV.fetch("TEST_DB_USERNAME", "docker") %> |