pfab 0.57.1 → 0.58.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +1 -1
- data/lib/pfab/cli.rb +28 -10
- data/lib/pfab/version.rb +2 -2
- data/pfab.gemspec +3 -3
- 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: 54465d79148f277fb4f811a42bd64515cfa91db27136f98d4c5bba1f51175b5f
|
4
|
+
data.tar.gz: 0fd8666d12d99292becd875d99d74a1250ea0fe6e5c1f40b3c4ff799b91b2068
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f117eac3ced18cf6fc03d04fa4f196922c0b37a6be27052f11b70ca7c13f6c657b279f17c3cec5ba22daa8b940572e3418992ed369580fee748194a4553cf3b3
|
7
|
+
data.tar.gz: '08692b693dc3894006f5879a7b91ed9364a8165047444714b7c1fc6c117991d34afd6b2db3617d0dd4ac336b7f4d1cce972c299781e9158169ceaab63a66bbd0'
|
data/README.markdown
CHANGED
data/lib/pfab/cli.rb
CHANGED
@@ -206,18 +206,34 @@ module Pfab
|
|
206
206
|
|
207
207
|
def cmd_apply
|
208
208
|
set_kube_context
|
209
|
+
success = true
|
210
|
+
|
209
211
|
get_apps.each do |app_name|
|
210
212
|
app = deployables[app_name]
|
211
213
|
if app[:deployable_type] == "cron"
|
212
214
|
deployed_name = deployed_name(app)
|
213
|
-
kubectl("delete cronjob -l deployed-name=#{deployed_name}")
|
215
|
+
success &= kubectl("delete cronjob -l deployed-name=#{deployed_name}")
|
214
216
|
end
|
215
|
-
kubectl("apply -f .application-k8s-#{$env}-#{app_name}.yaml")
|
216
|
-
puts_and_system("git tag release-#{$env}-#{app_name}-#{Time.now.strftime("%Y-%m-%d-%H-%M-%S")} HEAD")
|
217
|
-
puts_and_system("git push origin --tags")
|
217
|
+
success &= kubectl("apply -f .application-k8s-#{$env}-#{app_name}.yaml")
|
218
|
+
success &= puts_and_system("git tag release-#{$env}-#{app_name}-#{Time.now.strftime("%Y-%m-%d-%H-%M-%S")} HEAD")
|
219
|
+
success &= puts_and_system("git push origin --tags")
|
218
220
|
end
|
221
|
+
|
219
222
|
selector = "application=#{@application_yaml['name']}"
|
220
|
-
|
223
|
+
|
224
|
+
# Get the deployment for the given selector
|
225
|
+
deployment_json = `kubectl get deployment -l #{selector} -o json --namespace=#{yy.namespace}`
|
226
|
+
deployment = JSON.parse(deployment_json)
|
227
|
+
|
228
|
+
if deployment["items"].any?
|
229
|
+
deployment_name = deployment["items"].first["metadata"]["name"]
|
230
|
+
success &= kubectl("rollout status deployment/#{deployment_name} --timeout=60s")
|
231
|
+
else
|
232
|
+
puts "No deployment found for selector: #{selector}"
|
233
|
+
success = false
|
234
|
+
end
|
235
|
+
|
236
|
+
exit(success ? 0 : 1)
|
221
237
|
end
|
222
238
|
|
223
239
|
def image_exists?(full_image_name)
|
@@ -339,16 +355,18 @@ module Pfab
|
|
339
355
|
@_config ||= YAML.load(File.read(File.join(Dir.home, ".pfab.yaml")))
|
340
356
|
end
|
341
357
|
|
342
|
-
def kubectl
|
343
|
-
puts_and_system
|
358
|
+
def kubectl(cmd, post_cmd = "")
|
359
|
+
result = puts_and_system("kubectl #{cmd} --namespace=#{yy.namespace} #{post_cmd}")
|
360
|
+
result == true
|
344
361
|
end
|
345
362
|
|
346
|
-
def puts_and_system
|
363
|
+
def puts_and_system(cmd)
|
347
364
|
puts cmd
|
348
365
|
if $dryrun
|
349
366
|
puts "dry run, didn't run that"
|
367
|
+
true
|
350
368
|
else
|
351
|
-
system
|
369
|
+
system(cmd)
|
352
370
|
end
|
353
371
|
end
|
354
372
|
|
@@ -406,4 +424,4 @@ module Pfab
|
|
406
424
|
(name == "all") ? deployables.keys : [name]
|
407
425
|
end
|
408
426
|
end
|
409
|
-
end
|
427
|
+
end
|
data/lib/pfab/version.rb
CHANGED
data/pfab.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
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.
|
5
|
+
# stub: pfab 0.58.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "pfab".freeze
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.58.0"
|
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]
|
13
13
|
s.authors = ["Jeff Dwyer".freeze]
|
14
|
-
s.date = "2024-07
|
14
|
+
s.date = "2024-10-07"
|
15
15
|
s.description = "k8s helper".freeze
|
16
16
|
s.email = "jdwyer@prefab.cloud".freeze
|
17
17
|
s.executables = ["pfab".freeze]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pfab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.58.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Dwyer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07
|
11
|
+
date: 2024-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|