kubernetes-deploy 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: 821c10919c954524f0e04068a6335ca187e83282
4
- data.tar.gz: 0e63e63103fd2a0c5e8725553649b710670401bc
3
+ metadata.gz: a66de972d0f1d21cd2034ef65b2e5e30f2152e91
4
+ data.tar.gz: 207ecb8b75891de54c30acba082d55f85a9e3272
5
5
  SHA512:
6
- metadata.gz: 0981745c90e24271e2c95ee825a62c57bb86823d3de470109151187f0adc085f6812402a1cbf50df751e43083cce5f5de9883f1147f2aab53296e93647ce5da0
7
- data.tar.gz: d608ff476b6e72ec54b5501ef3ff31a3f20218295623a72b3dde8ae2a15f81a1ccd073e6026de120ab84e8a28663039033494f78f1e40d53dde9963eea70d732
6
+ metadata.gz: 4294f06b1cc979131b412a7a546aaf36c4793ef2921e641a0760bb93f24caca238781e27ae1d89b8eef47a90977ab2f78ec65cf4310440c023c0249de574cb26
7
+ data.tar.gz: 5a58d96ef5154fc75f46ca155aefa55b3b056ff1c51ee153e1e588565c10465d5214ce79b14c6da66d46154a103f9f54196a2a3de4a6ce0b788cb924919b0c51
@@ -4,6 +4,19 @@ require 'shellwords'
4
4
 
5
5
  module KubernetesDeploy
6
6
  class KubernetesResource
7
+ def self.logger=(value)
8
+ @logger = value
9
+ end
10
+
11
+ def self.logger
12
+ @logger ||= begin
13
+ l = Logger.new($stderr)
14
+ l.formatter = proc do |_severity, _datetime, _progname, msg|
15
+ "#{msg}\n"
16
+ end
17
+ l
18
+ end
19
+ end
7
20
 
8
21
  attr_reader :name, :namespace, :file, :context
9
22
  attr_writer :type, :deploy_started
@@ -112,7 +125,7 @@ module KubernetesDeploy
112
125
  end
113
126
 
114
127
  def log_status
115
- STDOUT.puts "[KUBESTATUS] #{JSON.dump(status_data)}"
128
+ KubernetesResource.logger.info("[KUBESTATUS][#{@context}][#{@namespace}] #{JSON.dump(status_data)}")
116
129
  end
117
130
  end
118
131
  end
@@ -25,7 +25,6 @@ module KubernetesDeploy
25
25
  pod = Pod.new(pod_name, namespace, context, nil, parent: "#{@name.capitalize} deployment")
26
26
  pod.deploy_started = @deploy_started
27
27
  pod.interpret_json_data(pod_json)
28
- pod.log_status
29
28
  @pods << pod
30
29
  end
31
30
  end
@@ -76,7 +76,7 @@ module KubernetesDeploy
76
76
  next unless st.success? && out.present?
77
77
 
78
78
  KubernetesDeploy.logger.info "Logs from #{id} container #{container_name}:"
79
- STDOUT.puts "#{out}"
79
+ KubernetesResource.logger.info(out)
80
80
  @already_displayed = true
81
81
  end
82
82
  end
@@ -319,7 +319,7 @@ MSG
319
319
  end
320
320
 
321
321
  def log_green(msg)
322
- STDOUT.puts "\033[0;32m#{msg}\x1b[0m\n" # green
322
+ KubernetesDeploy.logger.info("\033[0;32m#{msg}\x1b[0m")
323
323
  end
324
324
  end
325
325
  end
@@ -1,3 +1,3 @@
1
1
  module KubernetesDeploy
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubernetes-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kir Shatrov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2017-02-22 00:00:00.000000000 Z
13
+ date: 2017-02-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  requirements: []
119
119
  rubyforge_project:
120
- rubygems_version: 2.5.1
120
+ rubygems_version: 2.6.10
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Kubernetes deploy scripts