docker-stack 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/docker-stack.gemspec +4 -1
- data/lib/docker/stack.rb +36 -10
- data/lib/docker/stack/controller.rb +4 -2
- data/lib/docker/stack/localstack/endpoint_stub.rb +4 -2
- data/lib/docker/stack/version.rb +1 -1
- data/lib/generators/docker/stack/templates/config/database.yml.erb +1 -1
- metadata +51 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 80302c5dd736c970690c1aa29ceb94d79daf73724ed027e0dde75547816e4d24
|
4
|
+
data.tar.gz: 950a262dbff162954772b7087b174f8fe1fcabcfb98abd5e10ab188e26dd760c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5917fd1f09b87b401841f1c618584ddcf135bf768ee83412a3b9a213aa13acad9d7e9acd89fc190b6b3a616624ecdad2110e79093ce9a35fed63e8fbba03313
|
7
|
+
data.tar.gz: 2b1dce9db080d99cc8edb6d46b990d02db0c402d3cbafc523ccd2442a5e72eecba3ba67cbef421fd8309e9af768c4a86003e845e9ce2e7736194547d954361cd
|
data/docker-stack.gemspec
CHANGED
@@ -22,10 +22,12 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
|
+
spec.add_dependency 'actionview'
|
26
|
+
spec.add_dependency 'activesupport'
|
25
27
|
spec.add_dependency 'docker-api'
|
26
28
|
spec.add_dependency 'docker-compose'
|
27
|
-
spec.add_dependency 'rails', '~> 5.0'
|
28
29
|
|
30
|
+
spec.add_development_dependency 'aws-sdk-core'
|
29
31
|
spec.add_development_dependency 'bixby'
|
30
32
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
31
33
|
spec.add_development_dependency 'byebug'
|
@@ -33,6 +35,7 @@ Gem::Specification.new do |spec|
|
|
33
35
|
spec.add_development_dependency 'engine_cart'
|
34
36
|
spec.add_development_dependency 'mocha'
|
35
37
|
spec.add_development_dependency 'pry-byebug'
|
38
|
+
spec.add_development_dependency 'railties', '~> 5.0'
|
36
39
|
spec.add_development_dependency 'rake', '~> 12.0'
|
37
40
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
38
41
|
spec.add_development_dependency 'rubocop'
|
data/lib/docker/stack.rb
CHANGED
@@ -6,17 +6,43 @@ require 'docker/stack/version'
|
|
6
6
|
|
7
7
|
module Docker
|
8
8
|
module Stack
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
class << self
|
10
|
+
def port_for(service, environment = env)
|
11
|
+
port_map[service.to_s][environment.to_s]
|
12
|
+
end
|
13
|
+
|
14
|
+
def port_map
|
15
|
+
return @port_map unless @port_map.nil?
|
16
|
+
config_file = [
|
17
|
+
root.join('config', 'stack.yml'),
|
18
|
+
File.expand_path('../../config/stack.yml', __dir__)
|
19
|
+
].find { |f| File.exist?(f.to_s) }
|
20
|
+
@port_map = YAML.safe_load(File.read(config_file))
|
21
|
+
end
|
22
|
+
|
23
|
+
def env
|
24
|
+
@env ||= begin
|
25
|
+
((rails? && Rails.env))
|
26
|
+
rescue NoMethodError
|
27
|
+
ActiveSupport::StringInquirer.new(
|
28
|
+
ENV['RAILS_ENV'].presence || ENV['RACK_ENV'].presence || 'development'
|
29
|
+
)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def root
|
34
|
+
@root ||= begin
|
35
|
+
((rails? && Rails.root) || Pathname.pwd)
|
36
|
+
rescue NoMethodError
|
37
|
+
Pathname.pwd
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
12
42
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
Rails.root&.join('config', 'stack.yml'),
|
17
|
-
File.expand_path('../../config/stack.yml', __dir__)
|
18
|
-
].find { |f| File.exist?(f.to_s) }
|
19
|
-
@port_map = YAML.safe_load(File.read(config_file))
|
43
|
+
def rails?
|
44
|
+
defined?(Rails)
|
45
|
+
end
|
20
46
|
end
|
21
47
|
end
|
22
48
|
end
|
@@ -10,12 +10,14 @@ module Docker
|
|
10
10
|
|
11
11
|
def self.default_project_name
|
12
12
|
Rails.application.class.parent_name.underscore
|
13
|
+
rescue NoMethodError
|
14
|
+
Docker::Stack.root.basename.to_s
|
13
15
|
end
|
14
16
|
|
15
17
|
def initialize(project: self.class.default_project_name, env: nil, cleanup: false, daemon: false)
|
16
|
-
env =
|
18
|
+
env = Docker::Stack.env if env.nil?
|
17
19
|
project_and_env = [project, env].join('-')
|
18
|
-
@workdir =
|
20
|
+
@workdir = Docker::Stack.root.join('.docker-stack', project_and_env)
|
19
21
|
@dc = ::Docker::Compose::Session.new(dir: @workdir)
|
20
22
|
@cleanup = cleanup
|
21
23
|
@daemon = daemon
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'aws-sdk'
|
3
|
+
require 'aws-sdk-core'
|
4
4
|
|
5
5
|
module Docker
|
6
6
|
module Stack
|
@@ -49,7 +49,9 @@ module Docker
|
|
49
49
|
region: 'us-east-1',
|
50
50
|
credentials: Aws::Credentials.new('localstack-key', 'localstack-secret')
|
51
51
|
)
|
52
|
-
Seahorse::Client::Base.add_plugin(Plugin)
|
52
|
+
Seahorse::Client::Base.add_plugin(Plugin) unless Seahorse::Client::Base.plugins.include?(Plugin)
|
53
|
+
|
54
|
+
return unless defined?(Aws::S3)
|
53
55
|
Aws::S3::Plugins::BucketDns.options.find { |opt| opt.name == :force_path_style }.default = true
|
54
56
|
end
|
55
57
|
end
|
data/lib/docker/stack/version.rb
CHANGED
@@ -13,7 +13,7 @@ development:
|
|
13
13
|
|
14
14
|
test:
|
15
15
|
<<: *default
|
16
|
-
port: <%%=
|
16
|
+
port: <%%= Docker::Stack.env.development? ? <%= Docker::Stack.port_for(:postgres, 'development') %> : <%= Docker::Stack.port_for(:postgres, 'test') %> %>
|
17
17
|
database: docker_test
|
18
18
|
|
19
19
|
production:
|
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker-stack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Klein
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: actionview
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: docker-api
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,19 +67,19 @@ dependencies:
|
|
39
67
|
- !ruby/object:Gem::Version
|
40
68
|
version: '0'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
70
|
+
name: aws-sdk-core
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
44
72
|
requirements:
|
45
|
-
- - "
|
73
|
+
- - ">="
|
46
74
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
48
|
-
type: :
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
49
77
|
prerelease: false
|
50
78
|
version_requirements: !ruby/object:Gem::Requirement
|
51
79
|
requirements:
|
52
|
-
- - "
|
80
|
+
- - ">="
|
53
81
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
82
|
+
version: '0'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: bixby
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,6 +178,20 @@ dependencies:
|
|
150
178
|
- - ">="
|
151
179
|
- !ruby/object:Gem::Version
|
152
180
|
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: railties
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '5.0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '5.0'
|
153
195
|
- !ruby/object:Gem::Dependency
|
154
196
|
name: rake
|
155
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -273,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
315
|
version: '0'
|
274
316
|
requirements: []
|
275
317
|
rubyforge_project:
|
276
|
-
rubygems_version: 2.
|
318
|
+
rubygems_version: 2.7.3
|
277
319
|
signing_key:
|
278
320
|
specification_version: 4
|
279
321
|
summary: Support code and rake tasks for running Rails on top of Dockerized services.
|