phoebo 0.3.3 → 0.3.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c98ff805f2a0d711330de92f980f47f3dd73aad1
4
- data.tar.gz: 13a361ff06bb6ff9cf7e7e303e39f2d35a9637ad
3
+ metadata.gz: b02687c6a02c73020be2cbb439df797f779e094c
4
+ data.tar.gz: eb92a5b4e00451eaebe0bdf6807d36e9a5bbdf3a
5
5
  SHA512:
6
- metadata.gz: 77cb733064268a0cb83b4300b1c5debe7a6fafb2fa23fa8b6d9160f49835fd135d06c3d7a7c0e0072c233dcfa31630cb0f901e9ea2da3464b21199db8d5bd60f
7
- data.tar.gz: 2453756005d675bed1a927181e9010b1e7c430a93d558d175a4d59e56601b539e58063ec279e08b6380ae14896ccc07ac1af2c99823be970a691c39818e9079e
6
+ metadata.gz: e4ce79487f72c76dcc1920e20738d325d9f8b17ec6c2c052b54fe3ff7bf4b2e11edebbd4f330a18a4d23962287904ee3ab491db0328ebb7767b0c5d4f89af5c9
7
+ data.tar.gz: c9526f19ab92696fa0ef22eebf881bc38f49a12b7f9f1d15a98aa7cb7219ced1921696efbeb9265626ac9b952a2cb8bf6245d6089d2fa105b458e622aca19f01
@@ -49,12 +49,6 @@ module Phoebo
49
49
  raise Phoebo::SyntaxError.new("You need to define image for #{id}.")
50
50
  end
51
51
  end
52
-
53
- if @request.ref
54
- unless task[:image] =~ /:[^:]+$/i
55
- task[:image] += ":#{@request.ref.downcase}"
56
- end
57
- end
58
52
  end
59
53
 
60
54
  self
@@ -7,6 +7,8 @@ module Phoebo
7
7
  @actions = []
8
8
  @name = name
9
9
 
10
+ raise Phoebo::SyntaxError.new('Invalid image name.') if name.include?(':')
11
+
10
12
  if options.is_a?(Hash)
11
13
 
12
14
  # image('my-image', from: 'base-image')
@@ -49,9 +49,19 @@ module Phoebo
49
49
  stdout.print " virtual size: " + ('%.2f MB' % (built_image.json['VirtualSize'].to_f / 1000 / 1000)).cyan
50
50
  stdout.puts
51
51
 
52
- tag = @request.ref ? @request.ref[0...8] : 'latest'
52
+ if @request.ref
53
+ if @request.ref =~ /^[0-9a-f]+$/i
54
+ tag = @request.ref[0...8]
55
+ else
56
+ tag = @request.ref
57
+ end
58
+ else
59
+ tag = 'latest'
60
+ end
61
+
53
62
  stdout.puts "Tagging image #{built_image.id.to_s.cyan} -> #{image.name.cyan}#{':'.cyan}#{tag.cyan}"
54
63
  built_image.tag('repo' => image.name, 'tag' => tag, 'force' => true)
64
+ image.name += ":#{tag}"
55
65
 
56
66
  # Return image ID
57
67
  built_image.id
@@ -1,3 +1,3 @@
1
1
  module Phoebo
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phoebo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Staněk