docker-rails 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd13b3e449ebecf3beeeaf1ccce34d9d8a4d82ad
4
- data.tar.gz: ef722489bc87dd8c6078d470360289456633f0f7
3
+ metadata.gz: 8076e4ce6d1d20d727afadb4c99e5b9e57c18e21
4
+ data.tar.gz: 235f58b8be4f973954bbad1055df04b7bfb2a523
5
5
  SHA512:
6
- metadata.gz: 5a166ca39b19deacf676c1794066b51c05ff3885f76398785c3d28f2d95d2d977926cec5fbb11ed3703925df04b5ae676debe4d0a2a3ac1a6a4e64c6529a8ee8
7
- data.tar.gz: 51f1969e15638ecdd42f8cf20d2c8838d7e947c19158a7af6ed41b4406f28ecc91ee24b72f2d92905e2b0146eef8df14216e79a60a3b106721edc945dd2d0706
6
+ metadata.gz: 92189a1adf213f3cbb9def7fc31e95819c251c7b2a2e196add0971ce97bcc1c733d9af9154a8597d28eb03518fda597627df3418421e0b1d242899afe05e28ed
7
+ data.tar.gz: 5f977d58eebb066ce2a7717000dc60d6836010e55633dcd4b07e74f5ee61b48be34a417479e02186d4656a8df0f34775c7663dfa08630624cea6ae9e2e795aa9
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.0
4
+ - 2.2.2
5
+ - ruby-head
6
+ - jruby-head
7
+
8
+ matrix:
9
+ allow_failures:
10
+ - rvm: ruby-head
11
+ - rvm: jruby-head
12
+
13
+ script: rake
data/README.md CHANGED
@@ -1,15 +1,17 @@
1
1
  # docker-rails
2
+ [![Gem Version](https://badge.fury.io/rb/docker-rails.svg)](https://rubygems.org/gems/docker-rails)
3
+ [![Build Status](https://travis-ci.org/alienfast/docker-rails.svg)](https://travis-ci.org/alienfast/docker-rails)
4
+ [![Code Climate](https://codeclimate.com/github/alienfast/docker-rails/badges/gpa.svg)](https://codeclimate.com/github/alienfast/docker-rails)
2
5
 
3
6
  A simplified pattern to execute rails applications within Docker (with a CI build emphasis).
4
7
 
5
8
  ## Features
6
9
  - Provides individual functions for development/test usage, or a full workflow for CI usage (with automated container, volume, and image cleanup).
7
- - Automated cached global gems data volume (automatic) based on ruby version
10
+ - Automated cached global gems data volume based on ruby version
8
11
  - DRY declarative `docker-rails.yml` allowing multiple environments to be defined with an inherited `docker-compose` configuration
9
12
  - Interpolates `docker-compose.yml` making CI builds much easier
10
13
  - DB check CLI function provided for docker-compose `command` to check if db is ready
11
14
 
12
-
13
15
  ## Usage
14
16
 
15
17
  ```bash
@@ -75,7 +77,7 @@ ENV DEBIAN_FRONTEND newt
75
77
  ### 2. Add a docker-rails.yml
76
78
 
77
79
  Environment variables will be interpolated, so feel free to use them.
78
- Below shows an example with all of the environments `development | test | parallel_tests | staging' to show reuse of the primary `docker-compose' configuration.
80
+ Below shows an example with all of the environments `development | test | parallel_tests | staging` to show reuse of the primary `docker-compose' configuration.
79
81
 
80
82
  ```yaml
81
83
  verbose: true
@@ -88,7 +90,7 @@ elasticsearch: &elasticsearch
88
90
  - "9200"
89
91
 
90
92
  development:
91
- docker-compose:
93
+ compose:
92
94
  <<: *elasticsearch
93
95
  web:
94
96
  links:
@@ -123,7 +125,7 @@ development:
123
125
 
124
126
  test:
125
127
  before_command: rm -Rf target
126
- docker-compose:
128
+ compose:
127
129
  <<: *elasticsearch
128
130
  web:
129
131
  links:
@@ -151,7 +153,7 @@ test:
151
153
 
152
154
  parallel_tests:
153
155
  before_command: rm -Rf target
154
- docker-compose:
156
+ compose:
155
157
  <<: *elasticsearch
156
158
  web:
157
159
  links:
@@ -179,7 +181,7 @@ parallel_tests:
179
181
  "
180
182
 
181
183
  staging:
182
- docker-compose:
184
+ compose:
183
185
  web:
184
186
  environment:
185
187
  - RAILS_ENV=staging
@@ -206,7 +208,8 @@ staging:
206
208
  && foreman start
207
209
  "
208
210
 
209
- docker-compose:
211
+ # base docker-compose configuration for all environments
212
+ compose:
210
213
  web:
211
214
  build: .
212
215
  working_dir: /project/spec/dummy
data/docker-rails.gemspec CHANGED
@@ -21,6 +21,8 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'bundler', '~> 1.6'
22
22
  s.add_development_dependency 'rake'
23
23
  s.add_development_dependency 'rspec'
24
+
25
+ # only needed at runtime for db_check mysql
24
26
  s.add_development_dependency 'mysql2', '~> 0.3.18' # http://stackoverflow.com/a/32466950/2363935
25
27
  s.add_development_dependency 'activerecord'
26
28
 
@@ -1,7 +1,6 @@
1
1
  module Docker
2
2
  module Rails
3
3
  module CLI
4
- require 'thor'
5
4
  class DbCheck < Thor
6
5
 
7
6
  default_task :help
@@ -14,9 +13,6 @@ module Docker
14
13
  option :password, desc: 'Password-less login if unspecified'
15
14
 
16
15
  def mysql
17
-
18
- App.instance
19
-
20
16
  # ping db to see if it is ready before continuing
21
17
  require 'rubygems'
22
18
  require 'active_record'
File without changes
File without changes
@@ -14,7 +14,7 @@ module Docker
14
14
 
15
15
  def load!(environment, *filenames)
16
16
  if environment.nil?
17
- puts 'Environment unspecified, generating docker-compose.yml based on root docker-compose yaml key.'
17
+ puts 'Environment unspecified, generating docker-compose.yml based on root :compose yaml key.'
18
18
  environment = 'docker-compose'
19
19
  end
20
20
 
@@ -27,7 +27,7 @@ module Docker
27
27
  end
28
28
 
29
29
  def write_docker_compose_file(output_filename = 'docker-compose.yml')
30
- write_yaml_file(output_filename, self[:'docker-compose'])
30
+ write_yaml_file(output_filename, self[:'compose'])
31
31
  end
32
32
 
33
33
  def to_yaml(config = @configuration)
@@ -1,5 +1,5 @@
1
1
  module Docker
2
2
  module Rails
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
@@ -44,11 +44,11 @@ describe Docker::Rails::Config do
44
44
  it 'should read default file' do
45
45
  assert_common_top_level_settings
46
46
 
47
- web = config[:'docker-compose'][:web]
47
+ web = config[:'compose'][:web]
48
48
  expect(web[:links]).to match_array %w(elasticsearch db)
49
49
  expect(web[:ports]).to match_array ['3000']
50
50
 
51
- elasticsearch = config[:'docker-compose'][:elasticsearch]
51
+ elasticsearch = config[:'compose'][:elasticsearch]
52
52
  expect(elasticsearch[:ports]).to match_array ['9200']
53
53
 
54
54
  # ensure no unnecessary environments make it into the resolved configuration
@@ -8,7 +8,7 @@ elasticsearch: &elasticsearch
8
8
  - "9200"
9
9
 
10
10
  development:
11
- docker-compose:
11
+ compose:
12
12
  <<: *elasticsearch
13
13
  web:
14
14
  links:
@@ -43,7 +43,7 @@ development:
43
43
 
44
44
  test:
45
45
  before_command: rm -Rf target
46
- docker-compose:
46
+ compose:
47
47
  <<: *elasticsearch
48
48
  web:
49
49
  links:
@@ -71,7 +71,7 @@ test:
71
71
 
72
72
  parallel_tests:
73
73
  before_command: rm -Rf target
74
- docker-compose:
74
+ compose:
75
75
  <<: *elasticsearch
76
76
  web:
77
77
  links:
@@ -99,7 +99,7 @@ parallel_tests:
99
99
  "
100
100
 
101
101
  staging:
102
- docker-compose:
102
+ compose:
103
103
  web:
104
104
  environment:
105
105
  - RAILS_ENV=staging
@@ -126,7 +126,7 @@ staging:
126
126
  && foreman start
127
127
  "
128
128
 
129
- docker-compose:
129
+ compose:
130
130
  web:
131
131
  build: .
132
132
  working_dir: /project/spec/dummy
@@ -143,7 +143,7 @@ docker-compose:
143
143
  # Mount the gems data volume container for cached bundler gem files
144
144
  - #{GEMS_VOLUME_NAME}
145
145
 
146
- # https://docs.docker.com/v1.6/docker-compose/cli/#environment-variables
146
+ # https://docs.docker.com/v1.6/compose/cli/#environment-variables
147
147
  environment:
148
148
  # Tell bundler where to get the files
149
149
  - GEM_HOME=#{GEMS_VOLUME_PATH}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Ross
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-17 00:00:00.000000000 Z
11
+ date: 2015-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -134,6 +134,7 @@ files:
134
134
  - ".rspec"
135
135
  - ".ruby-gemset"
136
136
  - ".ruby-version"
137
+ - ".travis.yml"
137
138
  - Gemfile
138
139
  - LICENSE.txt
139
140
  - README.md
@@ -141,10 +142,10 @@ files:
141
142
  - bin/docker-rails
142
143
  - docker-rails.gemspec
143
144
  - lib/docker/rails.rb
144
- - lib/docker/rails/CLI/db_check.rb
145
- - lib/docker/rails/CLI/gems_volume.rb
146
- - lib/docker/rails/CLI/main.rb
147
145
  - lib/docker/rails/app.rb
146
+ - lib/docker/rails/cli/db_check.rb
147
+ - lib/docker/rails/cli/gems_volume.rb
148
+ - lib/docker/rails/cli/main.rb
148
149
  - lib/docker/rails/compose_config.rb
149
150
  - lib/docker/rails/config.rb
150
151
  - lib/docker/rails/version.rb