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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45ec711f57e62a9f9ace663420b2d5052904e1a0a997de2e68bbc7e72612f7b4
4
- data.tar.gz: e41d1bb627f104f364ffef3392fe4e3d98b5cb4b7c9a76ba5eb375544dceb7b7
3
+ metadata.gz: 69154b96d9e2fadb249e833c1663cfdf448fcc11737c8a43f9c6a0fe60dae773
4
+ data.tar.gz: d12379bc7a1a75ec87eda38f658a6ee5e1fee76a2da4d0ee6fd2ec3c34dad550
5
5
  SHA512:
6
- metadata.gz: 12d0b0b8fc261672065828c51078dff7eb55e217745888291f6ca76d437875971aaef086f5bacd126e7d28302ccb4b5562e131c6ce3370d3c7bf8be4a4299de2
7
- data.tar.gz: e1b759306b453d366aa6b92e027210faee49075e59eede975b46b029ce99e0d9d3504608451faeaf22a70f1b26137014250eaf1336e2d2e03df471b07c0d83e0
6
+ metadata.gz: a8f860d935d894c7c9c63583e800476f8fd5238671dbd1d1e38a8ed4ba806a7d13be59e9f53ace690a9b54b93ba1ebe5c11fdb6cbf999f4766ea41483b776bac
7
+ data.tar.gz: 6b69b46b058e89a24463e12fa0bb40304d48e65ae6ad728c24080de5fcda7e11a17a53cbe8741dd6d728b6d7a696e790655a1e8b9457c771550078e2f29a997d
@@ -6,4 +6,13 @@ services:
6
6
  build:
7
7
  context: .
8
8
  dockerfile: ./Dockerfile
9
+ ports:
10
+ - 8080
11
+ environment:
12
+ - hello
13
+ service-b:
14
+ image: service-a
15
+ build: .
16
+ service-c:
17
+ image: service-a
9
18
 
@@ -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 ot found: #{dockerfile}" unless File.exist? dockerfile
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
@@ -1,5 +1,5 @@
1
1
  module BuildLabels
2
2
  class Builder
3
- VERSION = '0.0.14'
3
+ VERSION = '0.0.16'
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.14
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-25 00:00:00.000000000 Z
11
+ date: 2024-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake