pfab 0.20.0 → 0.23.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/Gemfile.lock +1 -1
- data/lib/pfab/cli.rb +33 -11
- data/lib/pfab/templates/base.rb +4 -0
- data/lib/pfab/version.rb +1 -1
- data/pfab.gemspec +4 -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: 714a03244225ab924ffc98c75b620eb8205e6631314f6f43f731f6016f4dd91f
|
4
|
+
data.tar.gz: 0bca11dc0205345aca57a8cbab34208a0b7144ffd79c0f9b4a21258aff54276c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e442240a6666c09f9b42c29d37a2abc6dd56c7ac158eec52f0c82c9d36ad4f70cc551b76289084fbc414054fcccffeb13b65e1642c48ebb539681016d3004a2
|
7
|
+
data.tar.gz: 2d9e9765c520d267ccb9e3e97eaa2148d60b62a8d665defd50bbb3971385e855a906e78910af5929e1e727a0c11cb30842eefe22d9a558ac91dbbaf0f1888bd2
|
data/Gemfile.lock
CHANGED
data/lib/pfab/cli.rb
CHANGED
@@ -31,8 +31,9 @@ module Pfab
|
|
31
31
|
c.syntax = "pfab build"
|
32
32
|
c.summary = "build image"
|
33
33
|
c.option "--force", "force build and push"
|
34
|
+
c.option "--check", "just check if built"
|
34
35
|
c.action do |_args, options|
|
35
|
-
cmd_build(force: options.force)
|
36
|
+
cmd_build(force: options.force, checkonly: options.check)
|
36
37
|
end
|
37
38
|
end
|
38
39
|
|
@@ -83,6 +84,18 @@ module Pfab
|
|
83
84
|
end
|
84
85
|
end
|
85
86
|
|
87
|
+
command :restart do |c|
|
88
|
+
c.syntax = "pfab restart"
|
89
|
+
c.summary = "rolling restart of a deployment"
|
90
|
+
c.description = "rolling restart of a deployment"
|
91
|
+
c.action do
|
92
|
+
set_kube_context
|
93
|
+
app_name = get_app_name
|
94
|
+
|
95
|
+
puts_and_system "kubectl rollout restart deployment.apps/#{app_name}"
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
86
99
|
command :exec do |c|
|
87
100
|
c.syntax = "pfab exec"
|
88
101
|
c.summary = "kubectl exec into a pod"
|
@@ -193,7 +206,16 @@ module Pfab
|
|
193
206
|
end
|
194
207
|
end
|
195
208
|
|
196
|
-
def
|
209
|
+
def image_exists?(full_image_name)
|
210
|
+
|
211
|
+
# return 0 if image exists 1 if not
|
212
|
+
cmd = "docker manifest inspect #{full_image_name} > /dev/null ; echo $?"
|
213
|
+
say "Looking for images with #{cmd}"
|
214
|
+
existing = `#{cmd}`.strip
|
215
|
+
existing == "0"
|
216
|
+
end
|
217
|
+
|
218
|
+
def cmd_build(force: false, checkonly: false)
|
197
219
|
rev = get_current_sha
|
198
220
|
say "This repo is at rev: #{rev}"
|
199
221
|
uncommitted_changes = !`git diff-index HEAD --`.empty?
|
@@ -209,14 +231,14 @@ module Pfab
|
|
209
231
|
|
210
232
|
full_image_name = "#{container_repository}/#{image_name}:#{rev}"
|
211
233
|
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
return
|
234
|
+
unless force
|
235
|
+
if image_exists?(full_image_name)
|
236
|
+
say "Found image #{full_image_name} already, skipping prebuild, build & push"
|
237
|
+
return true
|
238
|
+
else
|
239
|
+
say "No image #{full_image_name} present"
|
240
|
+
end
|
241
|
+
return if checkonly
|
220
242
|
end
|
221
243
|
|
222
244
|
say "No image #{full_image_name} present, building"
|
@@ -274,7 +296,7 @@ module Pfab
|
|
274
296
|
end
|
275
297
|
|
276
298
|
def get_current_sha
|
277
|
-
`git rev-parse --short --verify HEAD`.chomp
|
299
|
+
`git rev-parse --short=8 --verify HEAD`.chomp
|
278
300
|
end
|
279
301
|
|
280
302
|
def set_kube_context
|
data/lib/pfab/templates/base.rb
CHANGED
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.23.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.23.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 = "2022-07-
|
14
|
+
s.date = "2022-07-21"
|
15
15
|
s.description = "k8s helper".freeze
|
16
16
|
s.email = "jdwyer@prefab.cloud".freeze
|
17
17
|
s.executables = ["pfab".freeze]
|
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.files = [
|
23
23
|
".document",
|
24
24
|
".tool-versions",
|
25
|
+
"CODEOWNERS",
|
25
26
|
"Gemfile",
|
26
27
|
"Gemfile.lock",
|
27
28
|
"LICENSE.txt",
|
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.23.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: 2022-07-
|
11
|
+
date: 2022-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|