cuber 1.6.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: 39f690dbfe51c572573fa0bf59c5f43c1b2806576aed7249afafa94d9184f146
4
- data.tar.gz: 03a35ba128901bb1d2a86a95f517cfeb44383da40b5351914ccdda21e8d21315
3
+ metadata.gz: 687fb6dcbc68029a3b5f526d40afbea27d7a81c99d0609abeb294175daee01c0
4
+ data.tar.gz: 201bef4d047a5bee19fe884414ec90b282f1606a8340cdb5ab6e7be4f6f585f5
5
5
  SHA512:
6
- metadata.gz: 1800876c72eac1ad1066cf17bdf139ee3ce204c3d32eff529dad6fd031632a0c1c8b912012fb37ce900d912d76f846bdfd9ffdc505cbbc6e54f1fd80ceecff92
7
- data.tar.gz: f6a2dc6449e62325d82d988b392b9dd2cea53cc7584701fe7901093c7d6ceef009114f7dda2a95bec25f9426d40fcc56e333bd7240309f3d272341cde8a0a486
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
@@ -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.6.0'.freeze
2
+ VERSION = '1.7.0'.freeze
3
3
  end
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.6.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-11-01 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: