kubec 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/Gemfile +2 -0
  4. data/Rakefile +2 -0
  5. data/bin/console +1 -0
  6. data/exe/kubec +1 -0
  7. data/kubec.gemspec +2 -0
  8. data/lib/kubec/application.rb +2 -0
  9. data/lib/kubec/config/base.rb +2 -0
  10. data/lib/kubec/config/downloader.rb +2 -0
  11. data/lib/kubec/config.rb +2 -0
  12. data/lib/kubec/deploy.rb +2 -0
  13. data/lib/kubec/dsl/env.rb +2 -0
  14. data/lib/kubec/dsl/paths.rb +2 -0
  15. data/lib/kubec/dsl.rb +2 -0
  16. data/lib/kubec/install.rb +2 -0
  17. data/lib/kubec/kubernetes/config.rb +2 -0
  18. data/lib/kubec/kubernetes/config_map.rb +2 -0
  19. data/lib/kubec/kubernetes/container.rb +2 -0
  20. data/lib/kubec/kubernetes/cron_job.rb +2 -0
  21. data/lib/kubec/kubernetes/deployment.rb +2 -0
  22. data/lib/kubec/kubernetes/has_attribute.rb +2 -0
  23. data/lib/kubec/kubernetes/metadata.rb +2 -0
  24. data/lib/kubec/kubernetes/service.rb +2 -0
  25. data/lib/kubec/kubernetes/template.rb +2 -0
  26. data/lib/kubec/kubernetes/volume.rb +11 -0
  27. data/lib/kubec/kubernetes.rb +2 -0
  28. data/lib/kubec/setup.rb +2 -0
  29. data/lib/kubec/status/base.rb +2 -0
  30. data/lib/kubec/status/deployment.rb +2 -0
  31. data/lib/kubec/status/pod.rb +2 -0
  32. data/lib/kubec/status/service.rb +2 -0
  33. data/lib/kubec/status.rb +2 -0
  34. data/lib/kubec/tasks/config.rake +2 -0
  35. data/lib/kubec/tasks/deploy.rake +2 -0
  36. data/lib/kubec/tasks/install.rake +2 -0
  37. data/lib/kubec/tasks/restart.rake +5 -3
  38. data/lib/kubec/tasks/status.rake +2 -0
  39. data/lib/kubec/utils/helper.rb +2 -0
  40. data/lib/kubec/utils/humanize_time.rb +3 -1
  41. data/lib/kubec/utils.rb +2 -0
  42. data/lib/kubec/version.rb +3 -1
  43. data/lib/kubec.rb +2 -0
  44. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51e84d5858c15145d238b888d17c188cc1f7249e
4
- data.tar.gz: d62cfc9bee6dc8175671663fd49beef0e6fb54c8
3
+ metadata.gz: 98288e8129770078f433bbac2a568a01a0ae911c
4
+ data.tar.gz: 315fbf207df4a42dba6c85ab609f12a3eed0c8be
5
5
  SHA512:
6
- metadata.gz: 8b38a488c1d2e3bb9981c99d8cd2fb121472a04643131c4fd38fa56135c99820765c039ec726bd75e9f0a7888669f1074b264ca0f4d174f4591a15be4a9cfd6c
7
- data.tar.gz: cb169c03f45989b8d2cacf3bab1a940ed888767fb2de6ba4bd649aa14f68969e196605e8fceb9b99b14338daee42917619919ae5eef78cd3be9879087f28c19c
6
+ metadata.gz: 109d0f108d214e8c72d167cef844551f370940c41eabebb1cc4c18608cb5e10fe7ba1383adcfa7bbb32c36a30ef80a7458ce0791c86da4deb371828e714a4c9a
7
+ data.tar.gz: c077d1da8a8100ab5a3d46c2f3308a749a7cb8e2901aca869ae7a09ce18666238fdf56e486fa5e1aef3fff7f958af4b5eebe0b53dbc9750028e01ceb315bb7a1
data/.rubocop.yml CHANGED
@@ -1,2 +1,2 @@
1
1
  AllCops:
2
- TargetVersion: 2.4
2
+ TargetRubyVersion: 2.3
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'kubec'
data/exe/kubec CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'kubec'
4
5
 
data/kubec.gemspec CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('../lib', __FILE__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'kubec/version'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  # Kubec Application
3
5
  class Application < Rake::Application
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  # :nodoc:
3
5
  module Config
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  module Config
3
5
  # :nodoc:
data/lib/kubec/config.rb CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  load File.expand_path('../tasks/config.rake', __FILE__)
data/lib/kubec/deploy.rb CHANGED
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  load File.expand_path('../tasks/deploy.rake', __FILE__)
2
4
  load File.expand_path('../tasks/restart.rake', __FILE__)
data/lib/kubec/dsl/env.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  module DSL
3
5
  # ENV
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  module DSL
3
5
  # :nodoc:
data/lib/kubec/dsl.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'kubec/dsl/stages'
2
4
  require 'kubec/dsl/paths'
3
5
  require 'kubec/dsl/env'
data/lib/kubec/install.rb CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  load File.expand_path('../tasks/install.rake', __FILE__)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  class Kubernetes
3
5
  # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  class Kubernetes
3
5
  # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  class Kubernetes
3
5
  # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  class Kubernetes
3
5
  # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  class Kubernetes
3
5
  # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  class Kubernetes
3
5
  # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  class Kubernetes
3
5
  # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  class Kubernetes
3
5
  # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  class Kubernetes
3
5
  # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  class Kubernetes
3
5
  # :nodoc:
@@ -42,6 +44,15 @@ module Kubec
42
44
  end
43
45
  }
44
46
  end
47
+
48
+ def secret(name, items = nil)
49
+ self[:secret] = {
50
+ secretName: name,
51
+ items: items&.map do |key, path|
52
+ { key: key, path: path }
53
+ end
54
+ }
55
+ end
45
56
  end
46
57
  end
47
58
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  # Kubernetes
3
5
  class Kubernetes
data/lib/kubec/setup.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  include Kubec::DSL
2
4
 
3
5
  stages.each do |stage|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  # :nodoc:
3
5
  module Status
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  module Status
3
5
  # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  module Status
3
5
  # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  module Status
3
5
  # :nodoc:
data/lib/kubec/status.rb CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  load File.expand_path('../tasks/status.rake', __FILE__)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  namespace :config do
2
4
  desc 'Upload config files using ConfigMap'
3
5
  task push: ['deploy:namespace'] do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  namespace :deploy do
2
4
  task :namespace do
3
5
  Kubec::Kubernetes.ensure_namespace
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  task :install do
2
4
  template_path = File.expand_path('../../templates', __FILE__)
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  desc 'Restart all services'
2
4
  task :restart do
3
5
  # TODO: Refactor this section
@@ -7,11 +9,11 @@ task :restart do
7
9
  end
8
10
 
9
11
  Kubec::Utils::Helper.header 'Restarting deployments'
10
- Kubec::Kubernetes.deployment.each do |deploy|
12
+ Kubec::Kubernetes.deployment.map do |deploy|
11
13
  Thread.new do
12
14
  puts "=> Restart #{deploy.name}"
13
15
  scale(stage, deploy.name, 0)
14
16
  scale(stage, deploy.name, deploy.replicas)
15
- end.join
16
- end
17
+ end
18
+ end.each(&:join)
17
19
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  namespace :status do
2
4
  desc 'Show service status'
3
5
  task :service do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  module Utils
3
5
  # :nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  module Utils
3
5
  # :nodoc:
@@ -31,7 +33,7 @@ module Kubec
31
33
 
32
34
  def convert(secs)
33
35
  PAIRS.dup.map do |count, name|
34
- next unless secs > 0
36
+ next unless secs.positive?
35
37
  secs, n = secs.divmod(count)
36
38
  [n, name]
37
39
  end.compact.reverse
data/lib/kubec/utils.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
4
  # :nodoc:
3
5
  module Utils
data/lib/kubec/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kubec
2
- VERSION = '0.3.4'.freeze
4
+ VERSION = '0.3.5'
3
5
  end
data/lib/kubec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake'
2
4
  require 'json'
3
5
  require 'forwardable'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - 5xRuby
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-01-17 00:00:00.000000000 Z
12
+ date: 2018-01-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize