orchestration 0.6.4 → 0.6.5

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
  SHA256:
3
- metadata.gz: 99bdeb106830843d2a0e600151a4d80b411d21e86f25010d6c2379810ef85273
4
- data.tar.gz: 4b3828ec78541d1680d3e5749c0a2e428bed328313d17e13d3f4e0dc1bdb0e8b
3
+ metadata.gz: 22c01beaeb79e418062c87c7d0d8d9fdc472cc479c16a47d9be01ca0278abc04
4
+ data.tar.gz: 78ad03978e9fcdb0ebf9cf1a02af1395dc356cdf5dac048eb06ab741396f4166
5
5
  SHA512:
6
- metadata.gz: 0e5a03e78c1e442daa079a5d92540df52a148b7ea08b8fa3ecd55919d045e7fc239d5638d8a850565044b9c1d7065b39c4401a72db0daef0d299c622e86ee02f
7
- data.tar.gz: e2061ef7628599f65c05d28380376ef841a329f85408c2dfa84172907ada7392dc0ba556b01a6559f3869b1f7b6809304615ebe91a9970e71adc31d04a0e82ed
6
+ metadata.gz: 94d8bdc996d37ae9b51bfd3a44f945e0f30b466d3bebb753b535c9e63558962d0661905fd4690677e946789bef76d9276f7047c4c990e7d9cfe6518b584e752f
7
+ data.tar.gz: 9f785e2f76dac85f01c36db3fbc3d24724e52e4f36aaffe95f388e782b98b0d6f351b173383a42950405b3fe427901c4ba49c5a6e64d61f0b88c385e0a581393
data/README.md CHANGED
@@ -29,7 +29,7 @@ The below screenshot demonstrates _Orchestration_ being installed in a brand new
29
29
  Add _Orchestration_ to your Gemfile:
30
30
 
31
31
  ```ruby
32
- gem 'orchestration', '~> 0.6.4'
32
+ gem 'orchestration', '~> 0.6.5'
33
33
  ```
34
34
 
35
35
  Install:
@@ -3,6 +3,8 @@
3
3
  module Orchestration
4
4
  module DockerCompose
5
5
  class AppService
6
+ include ComposeHelpers
7
+
6
8
  def initialize(config, environment)
7
9
  @environment = environment
8
10
  @config = config
@@ -89,10 +91,6 @@ module Orchestration
89
91
  }
90
92
  end
91
93
 
92
- def networks
93
- { 'local' => {} }
94
- end
95
-
96
94
  def environment
97
95
  {
98
96
  'RAILS_LOG_TO_STDOUT' => '1',
@@ -42,6 +42,8 @@ module Orchestration
42
42
  ports(name).find { |mapping| mapping[:remote] == remote_port }
43
43
  .fetch(:local)
44
44
  .to_i
45
+ rescue NoMethodError
46
+ nil
45
47
  end
46
48
 
47
49
  private
@@ -13,6 +13,12 @@ module Orchestration
13
13
  # "3306" (docker will use an ephemeral host port which we will not use)
14
14
  "${sidecar-#{port}:}"
15
15
  end
16
+
17
+ def networks
18
+ service = self.class.name.rpartition('::').last.partition('Service').first.downcase
19
+ network_alias = %i[development test].include?(@environment) ? service : "#{service}-local"
20
+ { 'local' => { 'aliases' => [network_alias] } }
21
+ end
16
22
  end
17
23
  end
18
24
  end
@@ -33,12 +33,6 @@ module Orchestration
33
33
  adapter.default_port
34
34
  end
35
35
 
36
- def networks
37
- return {} unless @environment == :deployment
38
-
39
- { 'local' => { 'aliases' => ['database-local'] } }
40
- end
41
-
42
36
  def ports
43
37
  return {} unless %i[development test].include?(@environment)
44
38
 
@@ -15,7 +15,7 @@ module Orchestration
15
15
  def definition
16
16
  return nil unless @config.enabled?
17
17
 
18
- { 'image' => 'library/mongo' }.merge(ports).merge(volumes)
18
+ { 'image' => 'library/mongo', 'networks' => networks }.merge(ports).merge(volumes)
19
19
  end
20
20
 
21
21
  private
@@ -13,7 +13,7 @@ module Orchestration
13
13
  def definition
14
14
  return nil unless @config.enabled?
15
15
 
16
- { 'image' => 'library/rabbitmq:management' }.merge(ports)
16
+ { 'image' => 'library/rabbitmq:management', 'networks' => networks }.merge(ports)
17
17
  end
18
18
 
19
19
  def ports
@@ -214,7 +214,7 @@ start: _create-log-directory _clean-logs
214
214
  ifneq (,${compose_services})
215
215
  @$(call system,${compose_human} up --detach)
216
216
  ifeq (${env},$(filter ${env},test development))
217
- ${compose} up --detach --force-recreate --renew-anon-volumes --remove-orphans ${services} ${log} || ${exit_fail}
217
+ @${compose} up --detach --force-recreate --renew-anon-volumes --remove-orphans ${services} ${log} || ${exit_fail}
218
218
  @[ -n '${sidecar}' ] && \
219
219
  ( \
220
220
  $(call echo,(joining dependency network ${cyan}${network}${reset})) ; \
@@ -30,11 +30,8 @@ post-setup:
30
30
  # Launch all dependencies needed for a development environment and set up the
31
31
  # development database.
32
32
  #
33
- .PHONY: setup
33
+ .PHONY: develop
34
34
  develop:
35
35
  bundle install
36
- @$(MAKE) start env=test
37
- @$(MAKE) start env=development
38
- bundle exec rake db:create
39
- bundle exec rake db:migrate
40
- bundle exec rake db:seed
36
+ @$(MAKE) setup env=test
37
+ @$(MAKE) setup env=development
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orchestration
4
- VERSION = '0.6.4'
4
+ VERSION = '0.6.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orchestration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-23 00:00:00.000000000 Z
11
+ date: 2022-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: database_url