pfab 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pfab/cli.rb +19 -8
  3. data/lib/pfab/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9b74403a3e35834fc91e161a00965bd13444cd6dc5f4189947e7a5e92168a29
4
- data.tar.gz: fbac3572c2f5b0f59b20195fcdd77657b511f6af95d430fc8d71c23e7a079748
3
+ metadata.gz: c80def412f2a0527b88bb127543b59863ef43ef049a7b5192fd79f399a5ae706
4
+ data.tar.gz: 5176b0c7e1ab03193d6c174218b6cd37918831df6807441b966a9137afdacea8
5
5
  SHA512:
6
- metadata.gz: 01031a7a713ec836556fc3351c92955d46e67a6ed5dbdc73281fdb96b16d6aaa368a34b9fc61590d0f0aaa1cfcf13393e743b98a8cfc72c415f364b0f1e9f6ee
7
- data.tar.gz: cc337ac58b41e94928356bfa846099f29546966da829799dd07d1661da308ca12e606b2ccfef2d9ebb6bfd8cfb98ecd96e65a37e5cf8ef77b0b7a3c49d714e7e
6
+ metadata.gz: 564a5caf247097c151e13522a334568e6c7f9af3f61e1f38b3afe22c1ee0a25e4416219e1c176e52e7179ec496e67b10e454c4164172281966100c9d247eac40
7
+ data.tar.gz: cc624dbb446f95e5a619226bb15b53c42a7bec10131da87be5dc6cf6eb33cb962e06e512556136feb48805b17fad01e434274fb773681f1f0598bc73a3a4b294
data/lib/pfab/cli.rb CHANGED
@@ -209,11 +209,12 @@ module Pfab
209
209
 
210
210
  full_image_name = "#{container_repository}/#{image_name}:#{rev}"
211
211
 
212
- cmd = "docker images -q #{full_image_name}"
212
+ # return 0 if image exists 1 if not
213
+ cmd = "docker manifest inspect #{full_image_name} > /dev/null ; echo $?"
213
214
  say "Looking for images with #{cmd}"
214
- existing = `#{cmd}`
215
+ existing = `#{cmd}`.strip
215
216
 
216
- if !existing.to_s.empty? && !force
217
+ if existing == "0" && !force
217
218
  say "Found image #{full_image_name} already, skipping prebuild, build & push"
218
219
  return true
219
220
  end
@@ -234,13 +235,23 @@ module Pfab
234
235
  end
235
236
  end
236
237
 
237
- puts_and_system "docker build -t #{image_name} --platform amd64 ."
238
+ build_cmd = "docker build -t #{image_name} --platform amd64 ."
239
+ puts build_cmd
240
+ result = system(build_cmd)
238
241
 
239
- puts_and_system "docker tag #{image_name}:latest #{image_name}:#{rev}"
240
- puts_and_system "docker tag #{image_name}:#{rev} #{full_image_name}"
242
+ puts "Build Result #{result}"
243
+
244
+ if result
245
+ puts_and_system "docker tag #{image_name}:latest #{image_name}:#{rev}"
246
+ puts_and_system "docker tag #{image_name}:#{rev} #{full_image_name}"
247
+
248
+ puts_and_system "docker push #{container_repository}/#{image_name}:#{rev}"
249
+ return true
250
+ else
251
+ say "Build Did Not Succeed"
252
+ return false
253
+ end
241
254
 
242
- puts_and_system "docker push #{container_repository}/#{image_name}:#{rev}"
243
- return true
244
255
  end
245
256
 
246
257
  def yy
data/lib/pfab/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Pfab
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 16
4
+ MINOR = 17
5
5
  PATCH = 0
6
6
  BUILD = nil
7
7
 
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.16.0
4
+ version: 0.17.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-01-18 00:00:00.000000000 Z
11
+ date: 2022-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander