build-labels 0.0.21 → 0.0.23

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: ece715acff32709330b757daf3bde7df56b686cfdb48ae95274fde1cea6c629f
4
- data.tar.gz: 92de637e65532323c3ffb810c2eb1c5c4dba08724dde1c18f593b6c97a07933b
3
+ metadata.gz: 8772722e2a7ec325d72b266a30801d18695f5ea636649c2f94e7f13d4037ef8b
4
+ data.tar.gz: 9033c7235d8f9bb90489b8ce98014bd40920b96fa2782c636de8788d006c4f39
5
5
  SHA512:
6
- metadata.gz: bd5e5a24c460f2bb57f41a9206c45d99b4cf97dc2088f34ad760e287be95b611554d02fb3f6a728b2533b8f12e70da0e763464c3fb711cafea84530a15cdf2ba
7
- data.tar.gz: 0a5b06118df2116a5e76d15393a0c55ae34bddfd5ede44d4fda9c09e19d714dc346c598b23d594c6be2953cdb01d387c82ad25b12129174b935d6be3f3b66bba
6
+ metadata.gz: 41ab4d9e77a938d2b7cd71ecb0bdaa7d5535b7a379610f89014e24021d7bfef09a516835e5aef1be1b05aa5df0542fc9fcc29ba88a495fac9786111741b977f2
7
+ data.tar.gz: 459549fb7facd578d1c8357d9639abe2eeaf27c8892ea02a6fa9bc2e389dbfaac076288c4882a22d25b6d03d4a5957a7a3e9570b0d3725a3233e93c012a53a83
@@ -55,21 +55,23 @@ module BuildLabels
55
55
  end
56
56
  end
57
57
  def extend_compose(compose)
58
- compose['services'].transform_values! do |service|
58
+ compose['services'].each do |name, service|
59
+ service.delete_if {|k, v| !%w[image build].include? k }
59
60
  next unless service['build']
60
- service.slice!('image', 'build')
61
- service['build'] = { 'context' => service['build'] } if service['build'].is_a?(String)
61
+ if service['build'].class == String
62
+ service['build'] = { 'context' => service['build'] }
63
+ end
62
64
  service['build']['labels'] ||= []
63
- add_namespace(:dc, 'docker.service')
64
- self.dc.name = service['name']
65
+ add_namespace :dc, 'docker.service'
66
+ self.dc.name = name
65
67
 
66
68
  each_labels do |ns, values|
67
- values.each do |k, v|
69
+ values.each_pair do |k,v|
68
70
  service['build']['labels'] << "#{ns}.#{k}=#{v}" unless v.to_s.empty?
69
71
  end
70
72
  end
71
- service
72
- end.compact!
73
+ end
74
+ compose['services'].delete_if do |name, svc| ! svc.key?('build') end
73
75
 
74
76
  puts compose.to_yaml
75
77
  end
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module BuildLabels
2
2
  class Builder
3
- VERSION = '0.0.21'
3
+ VERSION = '0.0.23'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-labels
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.23
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-07-29 00:00:00.000000000 Z
11
+ date: 2024-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake