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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54465d79148f277fb4f811a42bd64515cfa91db27136f98d4c5bba1f51175b5f
4
- data.tar.gz: 0fd8666d12d99292becd875d99d74a1250ea0fe6e5c1f40b3c4ff799b91b2068
3
+ metadata.gz: f5439bb786614722bb5525cf32208b7526d5fbd6bdd32ce1f65657c03e109201
4
+ data.tar.gz: fff1fbdebaca8be995c117192aa451522effb09376c51158c13092bf273c7f14
5
5
  SHA512:
6
- metadata.gz: f117eac3ced18cf6fc03d04fa4f196922c0b37a6be27052f11b70ca7c13f6c657b279f17c3cec5ba22daa8b940572e3418992ed369580fee748194a4553cf3b3
7
- data.tar.gz: '08692b693dc3894006f5879a7b91ed9364a8165047444714b7c1fc6c117991d34afd6b2db3617d0dd4ac336b7f4d1cce972c299781e9158169ceaab63a66bbd0'
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 the deployment for the given selector
227
+ # Get all deployments for the given selector
225
228
  deployment_json = `kubectl get deployment -l #{selector} -o json --namespace=#{yy.namespace}`
226
- deployment = JSON.parse(deployment_json)
229
+ deployments = JSON.parse(deployment_json)
227
230
 
228
- if deployment["items"].any?
229
- deployment_name = deployment["items"].first["metadata"]["name"]
230
- success &= kubectl("rollout status deployment/#{deployment_name} --timeout=60s")
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 deployment found for selector: #{selector}"
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
@@ -2,7 +2,7 @@ module Pfab
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 58
5
- PATCH = 0
5
+ PATCH = 1
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
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.0 ruby lib
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.0"
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.3.7".freeze
49
+ s.rubygems_version = "3.4.10".freeze
50
50
  s.summary = "helper gem".freeze
51
51
 
52
- if s.respond_to? :specification_version then
53
- s.specification_version = 4
54
- end
52
+ s.specification_version = 4
55
53
 
56
- if s.respond_to? :add_runtime_dependency then
57
- s.add_runtime_dependency(%q<commander>.freeze, [">= 0"])
58
- s.add_runtime_dependency(%q<activesupport>.freeze, [">= 0"])
59
- s.add_runtime_dependency(%q<pry-byebug>.freeze, [">= 0"])
60
- s.add_runtime_dependency(%q<styled_yaml>.freeze, ["~> 0.0.1"])
61
- s.add_development_dependency(%q<rdoc>.freeze, ["~> 6.1"])
62
- s.add_development_dependency(%q<bundler>.freeze, ["~> 2.3"])
63
- s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.4.9"])
64
- s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pfab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.58.0
4
+ version: 0.58.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dwyer