vidar 1.11.0 → 1.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bundler-version +1 -1
- data/.github/dependabot.yml +15 -0
- data/Gemfile.lock +17 -24
- data/lib/vidar/cli.rb +22 -10
- data/lib/vidar/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10d86c884b8a88a7211212d537f8fcb2351bb0c32c051900978aa9ad1ed2aa20
|
4
|
+
data.tar.gz: 101da0df09d2d4e04b68cc1f4b9006c7806b14ae693a3f09b2b2aa0d1cc1c69e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f79b3ff1660292fb00ed3fd85425e4e8c125c0c0cb8be761606de09fb2f5b8b49867a089f7cb5ec5b7c688f5e8af63d9e16ff4c3010c9e397d70e0f668c5b7e
|
7
|
+
data.tar.gz: 5ad12ad3a731169efe9fdb6a69a8b96bd52b9d9360f6a5b997578d928a9c4cce2efa7ef78c8342d41911404ae2acd6b4fe06ccd191a6f481831a390444ab6c84
|
data/.bundler-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.
|
1
|
+
2.5.16
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
vidar (1.
|
4
|
+
vidar (1.12.1)
|
5
5
|
colorize
|
6
6
|
faraday
|
7
7
|
thor (~> 1.0)
|
@@ -9,8 +9,8 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
addressable (2.8.
|
13
|
-
public_suffix (>= 2.0.2, <
|
12
|
+
addressable (2.8.7)
|
13
|
+
public_suffix (>= 2.0.2, < 7.0)
|
14
14
|
ast (2.4.2)
|
15
15
|
awesome_print (1.9.2)
|
16
16
|
bigdecimal (3.1.8)
|
@@ -20,69 +20,62 @@ GEM
|
|
20
20
|
bigdecimal
|
21
21
|
rexml
|
22
22
|
diff-lcs (1.5.1)
|
23
|
-
faraday (2.
|
23
|
+
faraday (2.10.0)
|
24
24
|
faraday-net_http (>= 2.0, < 3.2)
|
25
|
+
logger
|
25
26
|
faraday-net_http (3.1.0)
|
26
27
|
net-http
|
27
28
|
hashdiff (1.1.0)
|
28
29
|
json (2.7.2)
|
29
30
|
language_server-protocol (3.17.0.3)
|
31
|
+
logger (1.6.0)
|
30
32
|
method_source (1.1.0)
|
31
33
|
net-http (0.4.1)
|
32
34
|
uri
|
33
|
-
parallel (1.
|
34
|
-
parser (3.3.
|
35
|
+
parallel (1.25.1)
|
36
|
+
parser (3.3.4.0)
|
35
37
|
ast (~> 2.4.1)
|
36
38
|
racc
|
37
39
|
pry (0.14.2)
|
38
40
|
coderay (~> 1.1)
|
39
41
|
method_source (~> 1.0)
|
40
|
-
public_suffix (
|
42
|
+
public_suffix (6.0.0)
|
41
43
|
racc (1.8.0)
|
42
44
|
rainbow (3.1.1)
|
43
45
|
rake (13.2.1)
|
44
46
|
regexp_parser (2.9.2)
|
45
|
-
rexml (3.2
|
46
|
-
strscan
|
47
|
+
rexml (3.3.2)
|
48
|
+
strscan
|
47
49
|
rspec (3.13.0)
|
48
50
|
rspec-core (~> 3.13.0)
|
49
51
|
rspec-expectations (~> 3.13.0)
|
50
52
|
rspec-mocks (~> 3.13.0)
|
51
53
|
rspec-core (3.13.0)
|
52
54
|
rspec-support (~> 3.13.0)
|
53
|
-
rspec-expectations (3.13.
|
55
|
+
rspec-expectations (3.13.1)
|
54
56
|
diff-lcs (>= 1.2.0, < 2.0)
|
55
57
|
rspec-support (~> 3.13.0)
|
56
58
|
rspec-mocks (3.13.1)
|
57
59
|
diff-lcs (>= 1.2.0, < 2.0)
|
58
60
|
rspec-support (~> 3.13.0)
|
59
61
|
rspec-support (3.13.1)
|
60
|
-
rubocop (1.
|
62
|
+
rubocop (1.65.0)
|
61
63
|
json (~> 2.3)
|
62
64
|
language_server-protocol (>= 3.17.0)
|
63
65
|
parallel (~> 1.10)
|
64
66
|
parser (>= 3.3.0.2)
|
65
67
|
rainbow (>= 2.2.2, < 4.0)
|
66
|
-
regexp_parser (>=
|
68
|
+
regexp_parser (>= 2.4, < 3.0)
|
67
69
|
rexml (>= 3.2.5, < 4.0)
|
68
70
|
rubocop-ast (>= 1.31.1, < 2.0)
|
69
71
|
ruby-progressbar (~> 1.7)
|
70
72
|
unicode-display_width (>= 2.4.0, < 3.0)
|
71
73
|
rubocop-ast (1.31.3)
|
72
74
|
parser (>= 3.3.1.0)
|
73
|
-
rubocop-capybara (2.20.0)
|
74
|
-
rubocop (~> 1.41)
|
75
|
-
rubocop-factory_bot (2.25.1)
|
76
|
-
rubocop (~> 1.41)
|
77
75
|
rubocop-rake (0.6.0)
|
78
76
|
rubocop (~> 1.0)
|
79
|
-
rubocop-rspec (
|
80
|
-
rubocop (~> 1.
|
81
|
-
rubocop-capybara (~> 2.17)
|
82
|
-
rubocop-factory_bot (~> 2.22)
|
83
|
-
rubocop-rspec_rails (~> 2.28)
|
84
|
-
rubocop-rspec_rails (2.28.3)
|
85
|
-
rubocop (~> 1.40)
|
77
|
+
rubocop-rspec (3.0.3)
|
78
|
+
rubocop (~> 1.61)
|
86
79
|
ruby-progressbar (1.13.0)
|
87
80
|
strscan (3.1.0)
|
88
81
|
thor (1.3.1)
|
@@ -109,4 +102,4 @@ DEPENDENCIES
|
|
109
102
|
webmock
|
110
103
|
|
111
104
|
BUNDLED WITH
|
112
|
-
2.5.
|
105
|
+
2.5.16
|
data/lib/vidar/cli.rb
CHANGED
@@ -89,9 +89,11 @@ module Vidar
|
|
89
89
|
method_option :destination, required: false, default: "deployments,cronjobs"
|
90
90
|
method_option :container, required: false, default: "*"
|
91
91
|
method_option :all, required: false, type: :boolean, default: true
|
92
|
+
method_option :max_tries, required: false, default: "30"
|
92
93
|
def deploy
|
93
94
|
revision = options[:revision] || Config.get!(:revision)
|
94
95
|
kubectl_context = options[:kubectl_context] || Config.get!(:kubectl_context)
|
96
|
+
max_tries = options[:max_tries].to_i
|
95
97
|
Log.info "Current kubectl context: #{kubectl_context}"
|
96
98
|
|
97
99
|
Log.info "Looking for deploy hook..."
|
@@ -104,14 +106,7 @@ module Vidar
|
|
104
106
|
if template_name.to_s.empty?
|
105
107
|
Log.info "No deploy hook found"
|
106
108
|
else
|
107
|
-
|
108
|
-
Run.kubectl "delete job deploy-hook --ignore-not-found=true"
|
109
|
-
Run.kubectl "set image cronjobs/deploy-hook-template deploy-hook-template=#{Config.get!(:image)}:#{revision} --all"
|
110
|
-
Run.kubectl "create job deploy-hook --from=#{template_name}"
|
111
|
-
|
112
|
-
deploy_status = Vidar::DeployStatus.new(namespace: Config.get!(:namespace), filter: "deploy-hook")
|
113
|
-
deploy_status.wait_until_up
|
114
|
-
deploy_status.wait_until_completed
|
109
|
+
deploy_status = run_deploy_hook(template_name:, revision:, max_tries:)
|
115
110
|
|
116
111
|
unless deploy_status.success?
|
117
112
|
Run.kubectl "describe job deploy-hook"
|
@@ -163,14 +158,17 @@ module Vidar
|
|
163
158
|
end
|
164
159
|
|
165
160
|
desc "monitor_deploy_status", "Check is deployment has finished and sends post-deploy notification"
|
161
|
+
method_option :max_tries, required: false, default: "30"
|
166
162
|
def monitor_deploy_status
|
163
|
+
max_tries = options[:max_tries].to_i
|
164
|
+
|
167
165
|
Log.info "Current kubectl context: #{Config.get!(:kubectl_context)}"
|
168
|
-
Log.info "Checking if all containers in #{Config.get!(:namespace)} namespace(s) are ready..."
|
166
|
+
Log.info "Checking if all containers in #{Config.get!(:namespace)} namespace(s) are ready (#{max_tries} tries)..."
|
169
167
|
|
170
168
|
slack_notification = SlackNotification.get
|
171
169
|
honeycomb_notification = HoneycombNotification.get
|
172
170
|
|
173
|
-
deploy_status = Vidar::DeployStatus.new(namespace: Config.get!(:namespace))
|
171
|
+
deploy_status = Vidar::DeployStatus.new(namespace: Config.get!(:namespace), max_tries:)
|
174
172
|
|
175
173
|
deploy_status.wait_until_completed
|
176
174
|
|
@@ -257,5 +255,19 @@ module Vidar
|
|
257
255
|
|
258
256
|
slack_notification.deliver(message: options[:message]) if slack_notification.configured?
|
259
257
|
end
|
258
|
+
|
259
|
+
private
|
260
|
+
|
261
|
+
def run_deploy_hook(template_name:, revision:, max_tries:)
|
262
|
+
Log.info "Executing deploy hook #{template_name.strip!} (#{max_tries} tries)..."
|
263
|
+
Run.kubectl "delete job deploy-hook --ignore-not-found=true"
|
264
|
+
Run.kubectl "set image cronjobs/deploy-hook-template deploy-hook-template=#{Config.get!(:image)}:#{revision} --all"
|
265
|
+
Run.kubectl "create job deploy-hook --from=#{template_name}"
|
266
|
+
|
267
|
+
deploy_status = Vidar::DeployStatus.new(namespace: Config.get!(:namespace), filter: "deploy-hook", max_tries:)
|
268
|
+
deploy_status.wait_until_up
|
269
|
+
deploy_status.wait_until_completed
|
270
|
+
deploy_status
|
271
|
+
end
|
260
272
|
end
|
261
273
|
end
|
data/lib/vidar/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vidar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krzysztof Knapik
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-07-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- ".github/ISSUE_TEMPLATE/config.yml"
|
69
69
|
- ".github/ISSUE_TEMPLATE/story.md"
|
70
70
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
71
|
+
- ".github/dependabot.yml"
|
71
72
|
- ".github/workflows/auto-approve.yml"
|
72
73
|
- ".github/workflows/auto-merge.yml"
|
73
74
|
- ".github/workflows/ci.yml"
|
@@ -118,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
119
|
- !ruby/object:Gem::Version
|
119
120
|
version: '0'
|
120
121
|
requirements: []
|
121
|
-
rubygems_version: 3.5.
|
122
|
+
rubygems_version: 3.5.16
|
122
123
|
signing_key:
|
123
124
|
specification_version: 4
|
124
125
|
summary: K8s deployment tools based on thor
|