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 +4 -4
- data/lib/build-labels/builder.rb +10 -8
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8772722e2a7ec325d72b266a30801d18695f5ea636649c2f94e7f13d4037ef8b
|
4
|
+
data.tar.gz: 9033c7235d8f9bb90489b8ce98014bd40920b96fa2782c636de8788d006c4f39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41ab4d9e77a938d2b7cd71ecb0bdaa7d5535b7a379610f89014e24021d7bfef09a516835e5aef1be1b05aa5df0542fc9fcc29ba88a495fac9786111741b977f2
|
7
|
+
data.tar.gz: 459549fb7facd578d1c8357d9639abe2eeaf27c8892ea02a6fa9bc2e389dbfaac076288c4882a22d25b6d03d4a5957a7a3e9570b0d3725a3233e93c012a53a83
|
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
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.
|
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-
|
11
|
+
date: 2024-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|