blubber 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blubber/cli.rb +1 -18
- data/lib/blubber/flow.rb +17 -0
- data/lib/blubber/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: c9e5605e7db4c0a24f09d076e0391091c0021d106ed5570ea81e27208b1dd871
|
4
|
+
data.tar.gz: ae3d7e598c31d11819adc2f90ec198b8075161be66abe28548822c721a507305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 716d8eae016b585e0849d7e875bdda9c9fb9fcc5c6e66e39a5eb67b6afc4a1784d415000f6f12794adfae53ca6a0fad9657df7bde575e3d23f700b558037a00a
|
7
|
+
data.tar.gz: bf3fcad9de601a384df0a38fee32ba6d0c857fcf69c9f8f378e80577f3598da565baf7e37474ea55e0ac7e1e90af04f714a7126e758f5dc0a5bad352a22e72b3
|
data/lib/blubber/cli.rb
CHANGED
@@ -6,23 +6,6 @@ module Blubber
|
|
6
6
|
class Cli < Thor
|
7
7
|
desc 'build', 'Builds all found Docker images'
|
8
8
|
def build
|
9
|
-
|
10
|
-
images = layers.map { |layer| Flow.new(layer: layer).run }
|
11
|
-
|
12
|
-
table = [set_color('Layer', :bold), set_color('Tag', :bold)]
|
13
|
-
table += images.map do |(project, tags)|
|
14
|
-
tags.map do |tag|
|
15
|
-
[project, tag ]
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
puts HighLine.new.list(table.flatten, :columns_across, 2)
|
20
|
-
end
|
21
|
-
|
22
|
-
no_tasks do
|
23
|
-
def layers
|
24
|
-
@layers ||= Dir['**/*/Dockerfile'].map { |d| File.dirname(d) }
|
25
|
-
end
|
26
|
-
end
|
9
|
+
Flow.build
|
27
10
|
end
|
28
11
|
end
|
data/lib/blubber/flow.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'highline'
|
1
2
|
require 'open3'
|
2
3
|
|
3
4
|
require 'blubber/builder'
|
@@ -5,10 +6,26 @@ require 'blubber/tagger'
|
|
5
6
|
|
6
7
|
module Blubber
|
7
8
|
class Flow
|
9
|
+
def self.build(layers = nil)
|
10
|
+
layers ||= Dir['**/*/Dockerfile'].map { |d| File.dirname(d) }
|
11
|
+
|
12
|
+
images = layers.map { |layer| Flow.new(layer: layer).run }
|
13
|
+
|
14
|
+
table = [set_color('Layer', :bold), set_color('Tag', :bold)]
|
15
|
+
table += images.map do |(project, tags)|
|
16
|
+
tags.map do |tag|
|
17
|
+
[project, tag ]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
puts HighLine.new.list(table.flatten, :columns_across, 2)
|
22
|
+
end
|
23
|
+
|
8
24
|
def initialize(layer:)
|
9
25
|
@layer = layer
|
10
26
|
end
|
11
27
|
|
28
|
+
|
12
29
|
def run
|
13
30
|
image = Builder.new(layer: layer, logger: logger).run
|
14
31
|
return unless image[:success]
|
data/lib/blubber/version.rb
CHANGED