pfab 0.58.0 → 0.58.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pfab/cli.rb +26 -8
- data/lib/pfab/version.rb +1 -1
- data/pfab.gemspec +13 -27
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5439bb786614722bb5525cf32208b7526d5fbd6bdd32ce1f65657c03e109201
|
4
|
+
data.tar.gz: fff1fbdebaca8be995c117192aa451522effb09376c51158c13092bf273c7f14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e578cc68d28eb765a4c4dd25cddb2f8792253844e951129c42c504a1042e8b0fe5acc033f6457cf18ca4006826b54c2d50d4509b89f56e92e04ec4848cf81b1f
|
7
|
+
data.tar.gz: 62c984f80c304d4360f67fee40208359d0460f21274c8c84033a2d0048348283105e2a25d681c901e30957f5f7864f818c109537625ee655efc898e8206c0c88
|
data/lib/pfab/cli.rb
CHANGED
@@ -65,13 +65,16 @@ module Pfab
|
|
65
65
|
command :shipit do |c|
|
66
66
|
c.syntax = "pfab shipit"
|
67
67
|
c.summary = "build, generate, apply"
|
68
|
+
c.option "-t", "--timeout timeout", "timeout for rollout (default 240s)"
|
69
|
+
|
68
70
|
c.action do
|
71
|
+
options.default :timeout => 240
|
69
72
|
app_name = get_app_name(all: true)
|
70
73
|
puts "Shipping #{app_name}"
|
71
74
|
success = cmd_build
|
72
75
|
if success
|
73
76
|
cmd_generate_yaml
|
74
|
-
cmd_apply
|
77
|
+
cmd_apply(timeout: options.timeout)
|
75
78
|
end
|
76
79
|
end
|
77
80
|
end
|
@@ -204,7 +207,7 @@ module Pfab
|
|
204
207
|
run!
|
205
208
|
end
|
206
209
|
|
207
|
-
def cmd_apply
|
210
|
+
def cmd_apply(timeout: 240)
|
208
211
|
set_kube_context
|
209
212
|
success = true
|
210
213
|
|
@@ -221,18 +224,33 @@ module Pfab
|
|
221
224
|
|
222
225
|
selector = "application=#{@application_yaml['name']}"
|
223
226
|
|
224
|
-
# Get
|
227
|
+
# Get all deployments for the given selector
|
225
228
|
deployment_json = `kubectl get deployment -l #{selector} -o json --namespace=#{yy.namespace}`
|
226
|
-
|
229
|
+
deployments = JSON.parse(deployment_json)
|
227
230
|
|
228
|
-
if
|
229
|
-
|
230
|
-
|
231
|
+
if deployments["items"].any?
|
232
|
+
deployments["items"].each do |deployment|
|
233
|
+
deployment_name = deployment["metadata"]["name"]
|
234
|
+
puts "Waiting for deployment #{deployment_name} to roll out..."
|
235
|
+
rollout_success = kubectl("rollout status deployment/#{deployment_name} --timeout=#{timeout}s")
|
236
|
+
if rollout_success
|
237
|
+
puts "Deployment #{deployment_name} successfully rolled out."
|
238
|
+
else
|
239
|
+
puts "Deployment #{deployment_name} failed to roll out within the specified timeout."
|
240
|
+
end
|
241
|
+
success &= rollout_success
|
242
|
+
end
|
231
243
|
else
|
232
|
-
puts "No
|
244
|
+
puts "No deployments found for selector: #{selector}"
|
233
245
|
success = false
|
234
246
|
end
|
235
247
|
|
248
|
+
if success
|
249
|
+
puts "All deployments successfully rolled out."
|
250
|
+
else
|
251
|
+
puts "One or more deployments failed to roll out successfully."
|
252
|
+
end
|
253
|
+
|
236
254
|
exit(success ? 0 : 1)
|
237
255
|
end
|
238
256
|
|
data/lib/pfab/version.rb
CHANGED
data/pfab.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: pfab 0.58.
|
5
|
+
# stub: pfab 0.58.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "pfab".freeze
|
9
|
-
s.version = "0.58.
|
9
|
+
s.version = "0.58.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
@@ -46,33 +46,19 @@ Gem::Specification.new do |s|
|
|
46
46
|
]
|
47
47
|
s.homepage = "http://github.com/prefab-cloud/pfab".freeze
|
48
48
|
s.licenses = ["MIT".freeze]
|
49
|
-
s.rubygems_version = "3.
|
49
|
+
s.rubygems_version = "3.4.10".freeze
|
50
50
|
s.summary = "helper gem".freeze
|
51
51
|
|
52
|
-
|
53
|
-
s.specification_version = 4
|
54
|
-
end
|
52
|
+
s.specification_version = 4
|
55
53
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
s.add_development_dependency(%q<test-unit>.freeze, [">= 0"])
|
66
|
-
else
|
67
|
-
s.add_dependency(%q<commander>.freeze, [">= 0"])
|
68
|
-
s.add_dependency(%q<activesupport>.freeze, [">= 0"])
|
69
|
-
s.add_dependency(%q<pry-byebug>.freeze, [">= 0"])
|
70
|
-
s.add_dependency(%q<styled_yaml>.freeze, ["~> 0.0.1"])
|
71
|
-
s.add_dependency(%q<rdoc>.freeze, ["~> 6.1"])
|
72
|
-
s.add_dependency(%q<bundler>.freeze, ["~> 2.3"])
|
73
|
-
s.add_dependency(%q<juwelier>.freeze, ["~> 2.4.9"])
|
74
|
-
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
75
|
-
s.add_dependency(%q<test-unit>.freeze, [">= 0"])
|
76
|
-
end
|
54
|
+
s.add_runtime_dependency(%q<commander>.freeze, [">= 0"])
|
55
|
+
s.add_runtime_dependency(%q<activesupport>.freeze, [">= 0"])
|
56
|
+
s.add_runtime_dependency(%q<pry-byebug>.freeze, [">= 0"])
|
57
|
+
s.add_runtime_dependency(%q<styled_yaml>.freeze, ["~> 0.0.1"])
|
58
|
+
s.add_development_dependency(%q<rdoc>.freeze, ["~> 6.1"])
|
59
|
+
s.add_development_dependency(%q<bundler>.freeze, ["~> 2.3"])
|
60
|
+
s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.4.9"])
|
61
|
+
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
62
|
+
s.add_development_dependency(%q<test-unit>.freeze, [">= 0"])
|
77
63
|
end
|
78
64
|
|