pfab 0.16.0 → 0.17.0
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 +19 -8
- data/lib/pfab/version.rb +1 -1
- 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: c80def412f2a0527b88bb127543b59863ef43ef049a7b5192fd79f399a5ae706
|
4
|
+
data.tar.gz: 5176b0c7e1ab03193d6c174218b6cd37918831df6807441b966a9137afdacea8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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
|
-
|
238
|
+
build_cmd = "docker build -t #{image_name} --platform amd64 ."
|
239
|
+
puts build_cmd
|
240
|
+
result = system(build_cmd)
|
238
241
|
|
239
|
-
|
240
|
-
|
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
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.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-
|
11
|
+
date: 2022-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|