build-labels 0.0.14 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/simple-compose.yml +9 -0
- data/lib/build-labels/builder.rb +2 -0
- data/lib/build-labels/command_to_dockerfiles.rb +1 -1
- 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: 69154b96d9e2fadb249e833c1663cfdf448fcc11737c8a43f9c6a0fe60dae773
|
4
|
+
data.tar.gz: d12379bc7a1a75ec87eda38f658a6ee5e1fee76a2da4d0ee6fd2ec3c34dad550
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8f860d935d894c7c9c63583e800476f8fd5238671dbd1d1e38a8ed4ba806a7d13be59e9f53ace690a9b54b93ba1ebe5c11fdb6cbf999f4766ea41483b776bac
|
7
|
+
data.tar.gz: 6b69b46b058e89a24463e12fa0bb40304d48e65ae6ad728c24080de5fcda7e11a17a53cbe8741dd6d728b6d7a696e790655a1e8b9457c771550078e2f29a997d
|
data/examples/simple-compose.yml
CHANGED
data/lib/build-labels/builder.rb
CHANGED
@@ -54,6 +54,7 @@ module BuildLabels
|
|
54
54
|
def extend_compose(compose_text)
|
55
55
|
compose = YAML.load compose_text
|
56
56
|
compose['services'].each do |name, service|
|
57
|
+
service.delete_if {|k, v| !%w[image build].include? k }
|
57
58
|
next unless service['build']
|
58
59
|
if service['build'].class == String
|
59
60
|
service['build'] = { 'context' => service['build'] }
|
@@ -68,6 +69,7 @@ module BuildLabels
|
|
68
69
|
end
|
69
70
|
end
|
70
71
|
end
|
72
|
+
compose['services'].delete_if do |name, svc| ! svc.key?('build') end
|
71
73
|
puts compose.to_yaml
|
72
74
|
end
|
73
75
|
end
|
@@ -12,7 +12,7 @@ BuildLabels::CommandLine::COMMANDS[:to_dockerfiles] = Class.new do
|
|
12
12
|
dockerfile = svc['build'].is_a?(String) ? svc['build'] : svc['build']['context']
|
13
13
|
dockerfile = File.join dockerfile, (svc['build']['dockerfile'] || 'Dockerfile')
|
14
14
|
dockerfile = File.expand_path dockerfile, compose_dir
|
15
|
-
raise "file
|
15
|
+
raise "file not found: #{dockerfile}" unless File.exist? dockerfile
|
16
16
|
|
17
17
|
dockerfile_lines = File.readlines(dockerfile).map(&:rstrip)
|
18
18
|
|
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.16
|
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-
|
11
|
+
date: 2024-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|