dry-stack 0.0.75 → 0.0.76

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8221d44d262648628af5b10e205e899b1975f42f8858d53454e2eb71574ad790
4
- data.tar.gz: 13ef00456e8f06f4d16f8bfd2f2910a23d6a85d98f677e01af6842a64a41474d
3
+ metadata.gz: fc66cd52245000ece4ab555e7de7bebfb8bbc430fa874b7a193a98cb1b4252c7
4
+ data.tar.gz: fca08f1524e5108238fa3ed1767caec60b9760a1c8b4c29fb0805cc29faa7645
5
5
  SHA512:
6
- metadata.gz: 8a8d2bc4f1d15191cec5a4958657f33f0ddfa850c1dfcf7e0bb7ffc7b4cd7306002852b89120a828a0a2392572fdf4d78f20cb9b27ebd39fae48917ed7988334
7
- data.tar.gz: 6cbdad4504e7d3cb57344cd78e7057c4b88cef873f9b8187d0adec24b82947c8e1a367d8a62680543a45b07ff4cac0fba46447eb24f1c3571e5cfd6208366fc8
6
+ metadata.gz: 4dc22324c06865377ab541b63793070395df81fd2df72b7f3957482b603b712392436f579f27dfcb776cef9571798a12829c04701c67e88071ab80ef03016984
7
+ data.tar.gz: e339f2530b9529dbe94883bf8ef63757da1e66e05b23c7bbb90b1cb8ae694a4e00062563366ae083d00187c8fe038e432461b0822e4a21b28e7fffefd6bb05c4
@@ -215,13 +215,32 @@ module Dry
215
215
 
216
216
  service[:logging] ||= @logging[name.to_sym]
217
217
 
218
+ service[:volumes]&.map!&.with_index do |volume, index|
219
+ if volume.is_a? Hash
220
+ if (volume.key?(:name) && volume.key?(:source)) || (!volume.key?(:name) && !volume.key?(:source))
221
+ $stderr.puts 'Use either :name or :source in volume declaration as a Hash'
222
+ $stderr.puts ':name will create Volume section automatically'
223
+ raise 'invalid volume declaration'
224
+ end
225
+ if volume.key? :name
226
+ v_name = "#{service_name}-volume-#{index}".to_sym
227
+ compose[:volumes][v_name] ||= {}
228
+ compose[:volumes][v_name].merge! volume.slice(:name, :driver, :driver_opts)
229
+ volume[:type] ||= 'volume'
230
+ volume.except(:name, :driver, :driver_opts).merge source: v_name
231
+ else
232
+ volume
233
+ end
234
+ else
235
+ volume
236
+ end
237
+ end
238
+
218
239
  service[:configs]&.each_with_index do |config, index|
219
240
  config[:source] = "#{service_name}-config-#{index}" if config[:source].to_s.empty?
220
241
  compose[:configs][config[:source].to_sym] ||= {}
221
242
  compose[:configs][config[:source].to_sym].merge! config.except(:source, :target)
222
- config.delete :file_content
223
- config.delete :file
224
- config.delete :name
243
+ config.replace config.except :file_content, :file, :name
225
244
  end
226
245
  end
227
246
 
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  class Stack
3
- VERSION = '0.0.75'
3
+ VERSION = '0.0.76'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.75
4
+ version: 0.0.76
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artyom B
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-07 00:00:00.000000000 Z
11
+ date: 2024-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake