cuber 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cuber/cli.rb +1 -1
- data/lib/cuber/commands/info.rb +1 -1
- data/lib/cuber/cuberfile_validator.rb +5 -5
- data/lib/cuber/templates/deployment.yml.erb +20 -1
- data/lib/cuber/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c28c18ed3acd87a99a88d336b9b729d4089efe1f97224b9bc4d16058a7ace8e
|
4
|
+
data.tar.gz: 36957c9449da91c15284dbd041edef524627c33dbf3252300049baf717f64c5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8498fc1f4c44b8e6fe4ed0939eec0e6229bb44e0dc66da2eb1e504e3304d0e2f74dc5d5ba40a123f884d9550fa584e245400cf0a1e3124beda52c0a078a48628
|
7
|
+
data.tar.gz: 2f76ecbc4462b448069ec251ccfebbc9c4def63ca4be2e2378d37e63b3db8df38ea889830b4a1ef0e73be51a9f2de418fc81bb3f83c5c79eb46080825a2706d8
|
data/lib/cuber/cli.rb
CHANGED
@@ -27,7 +27,7 @@ module Cuber
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def parse_cuberfile
|
30
|
-
abort 'Cuberfile not found in current directory' unless File.
|
30
|
+
abort 'Cuberfile not found in current directory' unless File.exist? 'Cuberfile'
|
31
31
|
content = File.read 'Cuberfile'
|
32
32
|
parser = CuberfileParser.new
|
33
33
|
parser.instance_eval(content)
|
data/lib/cuber/commands/info.rb
CHANGED
@@ -98,7 +98,7 @@ module Cuber::Commands
|
|
98
98
|
schedule = cron['spec']['schedule']
|
99
99
|
command = cron['spec']['jobTemplate']['spec']['template']['spec']['containers'][0]['command'].shelljoin
|
100
100
|
last = cron['status']['lastScheduleTime']
|
101
|
-
puts "#{name}: #{schedule} #{command}
|
101
|
+
puts "#{name}: #{schedule} #{command} #{'(' + time_ago_in_words(last) + ')' if last}"
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
@@ -50,7 +50,7 @@ module Cuber
|
|
50
50
|
|
51
51
|
def validate_dockerfile
|
52
52
|
return unless @options[:dockerfile]
|
53
|
-
@errors << 'dockerfile must be a file' unless File.
|
53
|
+
@errors << 'dockerfile must be a file' unless File.exist? @options[:dockerfile]
|
54
54
|
end
|
55
55
|
|
56
56
|
def validate_image
|
@@ -64,12 +64,12 @@ module Cuber
|
|
64
64
|
|
65
65
|
def validate_dockerconfig
|
66
66
|
return unless @options[:dockerconfig]
|
67
|
-
@errors << 'dockerconfig must be a file' unless File.
|
67
|
+
@errors << 'dockerconfig must be a file' unless File.exist? @options[:dockerconfig]
|
68
68
|
end
|
69
69
|
|
70
70
|
def validate_kubeconfig
|
71
71
|
@errors << 'kubeconfig must be present' if @options[:kubeconfig].to_s.strip.empty?
|
72
|
-
@errors << 'kubeconfig must be a file' unless File.
|
72
|
+
@errors << 'kubeconfig must be a file' unless File.exist? @options[:kubeconfig]
|
73
73
|
end
|
74
74
|
|
75
75
|
def validate_migrate
|
@@ -123,8 +123,8 @@ module Cuber
|
|
123
123
|
|
124
124
|
def validate_ssl
|
125
125
|
return unless @options[:ssl]
|
126
|
-
@errors << 'ssl crt must be a file' unless File.
|
127
|
-
@errors << 'ssl key must be a file' unless File.
|
126
|
+
@errors << 'ssl crt must be a file' unless File.exist? @options[:ssl][:crt]
|
127
|
+
@errors << 'ssl key must be a file' unless File.exist? @options[:ssl][:key]
|
128
128
|
end
|
129
129
|
|
130
130
|
end
|
@@ -59,6 +59,23 @@ data:
|
|
59
59
|
<%= key %>: <%= value.to_s.to_json %>
|
60
60
|
<%- end -%>
|
61
61
|
|
62
|
+
---
|
63
|
+
apiVersion: policy/v1
|
64
|
+
kind: PodDisruptionBudget
|
65
|
+
metadata:
|
66
|
+
name: web-pdb
|
67
|
+
namespace: <%= @options[:app] %>
|
68
|
+
labels:
|
69
|
+
app.kubernetes.io/name: <%= @options[:app] %>
|
70
|
+
app.kubernetes.io/instance: <%= @options[:instance] %>
|
71
|
+
app.kubernetes.io/version: <%= @options[:release] %>
|
72
|
+
app.kubernetes.io/managed-by: cuber
|
73
|
+
spec:
|
74
|
+
maxUnavailable: "50%"
|
75
|
+
selector:
|
76
|
+
matchLabels:
|
77
|
+
app: web-proc
|
78
|
+
|
62
79
|
<%- if @options[:migrate] -%>
|
63
80
|
---
|
64
81
|
apiVersion: batch/v1
|
@@ -168,11 +185,13 @@ spec:
|
|
168
185
|
<%- if procname.to_s == 'web' && @options[:health] -%>
|
169
186
|
readinessProbe:
|
170
187
|
httpGet:
|
171
|
-
path: <%= URI.parse(@options[:health]).path.to_json %>
|
172
188
|
port: 8080
|
189
|
+
path: <%= URI.parse(@options[:health]).path.to_json %>
|
173
190
|
httpHeaders:
|
174
191
|
- name: Host
|
175
192
|
value: <%= URI.parse(@options[:health]).host.to_json %>
|
193
|
+
- name: X-Forwarded-Proto
|
194
|
+
value: <%= URI.parse(@options[:health]).scheme.to_json %>
|
176
195
|
<%- end -%>
|
177
196
|
<%- if @options[:migrate] && @options[:migrate][:check] -%>
|
178
197
|
initContainers:
|
data/lib/cuber/version.rb
CHANGED
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.
|
4
|
+
version: 1.8.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-
|
11
|
+
date: 2022-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|