cuber 1.5.0 → 1.7.0

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: 9539bae5c1054e978457c6d1bd927e5e88a28729f96b6f38b0c53a2cfe4764e1
4
- data.tar.gz: e1409bdb27a9bb7c9712e7aac2f60602ab5d2476f337de970132aff3992be20a
3
+ metadata.gz: 687fb6dcbc68029a3b5f526d40afbea27d7a81c99d0609abeb294175daee01c0
4
+ data.tar.gz: 201bef4d047a5bee19fe884414ec90b282f1606a8340cdb5ab6e7be4f6f585f5
5
5
  SHA512:
6
- metadata.gz: 6ad54e6e94ed208f42970099a2ed021e38627c9464b62307964d2edc07f4220679cbad49774e2574005ca91ef4f4c1752e9bf2b91fa8f9572ce4d94f678bc302
7
- data.tar.gz: c92c28ceb31dc4b2ead37b2cd1634ece46219ff6b83f1b8e2366bf8f02bb456283c250983d29d349920d39705928cfdbcad57d2e1b86ec83d72f2c63afb760b6
6
+ metadata.gz: ae0bcb075fe4ebe29f607c01b95de94308bcfb586e12498a5c369ae0162d362d8661581d90bb3b9a4e759f9fe3489ffe5760f203bc98ad4cca7c674405ff4b76
7
+ data.tar.gz: 30c8adb2b0ec54586b3402a5b5b9778c2ea4094c5f164e96de01641538dd9808e356e5f481fb18393f4276f614927b8bc81a69a8d308f00f3533416b29834f53
data/lib/cuber/cli.rb CHANGED
@@ -7,6 +7,7 @@ require 'yaml'
7
7
  require 'json'
8
8
  require 'shellwords'
9
9
  require 'time'
10
+ require 'uri'
10
11
 
11
12
  module Cuber
12
13
  class CLI
@@ -0,0 +1,14 @@
1
+ module Cuber::Commands
2
+ class Ctl
3
+ include Cuber::Utils
4
+
5
+ def initialize options
6
+ @options = options
7
+ end
8
+
9
+ def execute
10
+ kubectl *ARGV
11
+ end
12
+
13
+ end
14
+ end
@@ -15,6 +15,7 @@ module Cuber
15
15
  @cron = {}
16
16
  @secrets = {}
17
17
  @env = {}
18
+ @health = nil
18
19
  @lb = {}
19
20
  @ingress = nil
20
21
  @ssl = nil
@@ -75,6 +76,10 @@ module Cuber
75
76
  def env key, value, secret: false
76
77
  secret ? (@secrets[key] = value) : (@env[key] = value)
77
78
  end
79
+
80
+ def health url
81
+ @health = url
82
+ end
78
83
 
79
84
  def lb key, value
80
85
  @lb[key] = value
@@ -20,6 +20,7 @@ module Cuber
20
20
  validate_procs
21
21
  validate_cron
22
22
  validate_env
23
+ validate_health
23
24
  validate_lb
24
25
  validate_ingress
25
26
  validate_ssl
@@ -103,6 +104,11 @@ module Cuber
103
104
  @errors << "env \"#{key}\" name can only include uppercase letters, digits or underscores" if key !~ /\A[A-Z_]+[A-Z0-9_]*\z/
104
105
  end
105
106
  end
107
+
108
+ def validate_health
109
+ return unless @options[:health]
110
+ @errors << 'health checks must be an http url' unless URI.parse(@options[:health]).kind_of? URI::HTTP
111
+ end
106
112
 
107
113
  def validate_lb
108
114
  @options[:lb].each do |key, value|
@@ -164,10 +164,15 @@ spec:
164
164
  value: "8080"
165
165
  ports:
166
166
  - containerPort: 8080
167
+ <%- end -%>
168
+ <%- if procname.to_s == 'web' && @options[:health] -%>
167
169
  readinessProbe:
168
170
  httpGet:
169
- path: /
171
+ path: <%= URI.parse(@options[:health]).path.to_json %>
170
172
  port: 8080
173
+ httpHeaders:
174
+ - name: Host
175
+ value: <%= URI.parse(@options[:health]).host.to_json %>
171
176
  <%- end -%>
172
177
  <%- if @options[:migrate] && @options[:migrate][:check] -%>
173
178
  initContainers:
data/lib/cuber/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cuber
2
- VERSION = '1.5.0'.freeze
2
+ VERSION = '1.7.0'.freeze
3
3
  end
data/lib/cuber.rb CHANGED
@@ -9,6 +9,7 @@ require 'cuber/commands/logs'
9
9
  require 'cuber/commands/restart'
10
10
  require 'cuber/commands/run'
11
11
  require 'cuber/commands/deploy'
12
+ require 'cuber/commands/ctl'
12
13
 
13
14
  module Cuber
14
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cuber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-31 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -23,6 +23,7 @@ files:
23
23
  - cuber.gemspec
24
24
  - lib/cuber.rb
25
25
  - lib/cuber/cli.rb
26
+ - lib/cuber/commands/ctl.rb
26
27
  - lib/cuber/commands/deploy.rb
27
28
  - lib/cuber/commands/info.rb
28
29
  - lib/cuber/commands/logs.rb