build-labels 0.0.21 → 0.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/build-labels/builder.rb +10 -8
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50511bc850b411617f1d5c516593dbfe886de1d4230e76b3036c70ac9e7fa91e
|
4
|
+
data.tar.gz: 6f1d316b6941a45bd0451e17b322854172d9e1a5eb55eca39bb7039e2bcf1120
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3e4df0698922db01f4526405a9ce7c694a6fea149e86d4fbd90142ca6e1781cf8d2a22cb534049da6853b8fb3662cb65695c470fe099000fa4d06f15d3f30b2
|
7
|
+
data.tar.gz: 4afcd88dcf92dcf78f9c938a0902e486db8f10981f42b4a659877c4b5b2ae52f2c76ef5e3167713b48e424727424eb667ff16a640c586311f826df8438205d89
|
data/lib/build-labels/builder.rb
CHANGED
@@ -55,21 +55,23 @@ module BuildLabels
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
def extend_compose(compose)
|
58
|
-
compose['services'].
|
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
|
61
|
-
|
61
|
+
if service['build'].class == String
|
62
|
+
service['build'] = { 'context' => service['build'] }
|
63
|
+
end
|
62
64
|
service['build']['labels'] ||= []
|
63
|
-
add_namespace
|
64
|
-
self.dc.name =
|
65
|
+
add_namespace :dc, 'docker.service'
|
66
|
+
self.dc.name = name
|
65
67
|
|
66
68
|
each_labels do |ns, values|
|
67
|
-
values.
|
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
|
-
|
72
|
-
|
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