hako 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hako/application.rb +1 -1
- data/lib/hako/cli.rb +1 -1
- data/lib/hako/container.rb +9 -0
- data/lib/hako/version.rb +1 -1
- data/lib/hako/yaml_loader.rb +17 -15
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acb16772f9adf1b88875ca6b5512f18b7625b926
|
4
|
+
data.tar.gz: 570621547d7fcb12fa9a4687e08cf77e9c732e85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18bb12686bd0cac7c726c4dc759ecfbb071034bc41a9033a73dbd8d20f7d957cfe10d9af1652ef3906540c8408ccdccb6c9f25ad6380c9c9f9fb0523fae0f023
|
7
|
+
data.tar.gz: d18f665c6d2c61ee745deccb09e39d38518df4c610e281ca413dc0a1666ca3d584d311ddc83e4bd6ffb91eee6b3caf5df4e8bf726e1380d28bc47eccb0e04df9
|
data/lib/hako/application.rb
CHANGED
data/lib/hako/cli.rb
CHANGED
@@ -24,7 +24,7 @@ module Hako
|
|
24
24
|
desc 'show-yaml FILE', 'Show expanded YAML'
|
25
25
|
def show_yaml(yaml_path)
|
26
26
|
require 'hako/yaml_loader'
|
27
|
-
puts YamlLoader.load(Pathname.new(yaml_path)).to_yaml
|
27
|
+
puts YamlLoader.new.load(Pathname.new(yaml_path)).to_yaml
|
28
28
|
end
|
29
29
|
|
30
30
|
desc 'status FILE', 'Show deployment status'
|
data/lib/hako/container.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require 'hako/version'
|
3
|
+
|
2
4
|
module Hako
|
3
5
|
class Container
|
4
6
|
def initialize(app, definition, dry_run:)
|
5
7
|
@app = app
|
6
8
|
@definition = default_config.merge(definition)
|
9
|
+
@definition['docker_labels'].merge!(default_labels)
|
7
10
|
@dry_run = dry_run
|
8
11
|
end
|
9
12
|
|
@@ -54,5 +57,11 @@ module Hako
|
|
54
57
|
'links' => [],
|
55
58
|
}
|
56
59
|
end
|
60
|
+
|
61
|
+
def default_labels
|
62
|
+
{
|
63
|
+
'cc.wanko.hako.version' => VERSION,
|
64
|
+
}
|
65
|
+
end
|
57
66
|
end
|
58
67
|
end
|
data/lib/hako/version.rb
CHANGED
data/lib/hako/yaml_loader.rb
CHANGED
@@ -2,22 +2,24 @@
|
|
2
2
|
require 'psych'
|
3
3
|
|
4
4
|
module Hako
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
5
|
+
class YamlLoader
|
6
|
+
def initialize
|
7
|
+
@current_path = nil
|
8
|
+
end
|
9
|
+
|
10
|
+
def load(path)
|
11
|
+
class_loader = Psych::ClassLoader.new
|
12
|
+
scanner = Psych::ScalarScanner.new(class_loader)
|
13
|
+
prev_path = @current_path
|
14
|
+
@current_path = path
|
15
|
+
visitor = Visitor.new(scanner, class_loader) do |_, val|
|
16
|
+
load(@current_path.parent.join(val))
|
17
|
+
end
|
18
|
+
path.open do |f|
|
19
|
+
visitor.accept(Psych.parse(f))
|
20
20
|
end
|
21
|
+
ensure
|
22
|
+
@current_path = prev_path
|
21
23
|
end
|
22
24
|
|
23
25
|
class Visitor < Psych::Visitors::ToRuby
|