linecook-gem 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1c8717c45b4378989f8994fe2335400bd0d0063
4
- data.tar.gz: 046b4b462501d96909c68e9c119fc4a296c4b444
3
+ metadata.gz: 9fdef146633a6fad22b7e806afbdca1aa36a7b60
4
+ data.tar.gz: 983c91824d7525b3d7b20dab8ce8b97945e85dde
5
5
  SHA512:
6
- metadata.gz: b166e375c6836412fa1142937ce7ed0ed0f2807a0aece08b9651b4924d67ea296951a9ce679447be3b2d7329dd2d781f94d3b1e26d6580b6adc547ac6f22236d
7
- data.tar.gz: 31e0ab53ccacb17736e6c777ee422bb58a188674dc57e8ae4495aa814008c1c97f1154ba717975ffe9145946d507a63247fdd4466b279639c91d287be1947bd4
6
+ metadata.gz: 46fafb5a0911b11e827ef0cca448fcfac8a9ed621e7c0207c300188547e2a4135ee3294bb04badf0102121977b413a81b75cacb3d58e7fb8bc180ef5378f1e85
7
+ data.tar.gz: 4319ccedec408b0ad0ae956a7fcae9a9d4d0415b9ffd44c03d0de14a08d6ebeb1c9391e3b8f5b4f16dac645943e4d550d3c2e2dad554f004437a4015a04622bc
@@ -13,6 +13,7 @@ module Linecook
13
13
  Linecook::Builder.start
14
14
  @type = tag ? "#{name}-#{tag}" : name
15
15
  @id = id ? "#{@type}-#{id}" : @type
16
+ @id = @id.gsub(/[\/|\.]/,'_')
16
17
  @image = image || Linecook.config[:provisioner][:default_image]
17
18
  @container = Linecook::Lxc::Container.new(name: @id, image: @image, remote: Linecook::Builder.ssh)
18
19
  end
data/lib/linecook/cli.rb CHANGED
@@ -37,10 +37,16 @@ class Image < Thor
37
37
  puts Linecook::ImageManager.latest(id, **opts)
38
38
  end
39
39
 
40
- desc 'fetch IMAGE_NAME', 'Fetch an image by name'
41
- method_options name: :string
42
- def fetch(name)
43
- Linecook::ImageManager.fetch(name)
40
+ desc 'fetch', 'Fetch and decrypt an image'
41
+ method_option :type, type: :string, required: false, banner: 'ID', desc: 'Type of image to list', aliases: '-t'
42
+ method_option :latest, type: :boolean, default: false, desc: 'Use the latest build for type', aliases: '-l'
43
+ method_option :name, type: :string, required: false, banner: 'NAME', desc: 'Name of the image to snapshot. Specify this, or --latest with a type', aliases: '-n'
44
+ def fetch
45
+ fail 'Must specify image name or use latest' unless options[:name] || options[:latest]
46
+ fail 'Must specify type if specifying latest' if options[:latest] && !options[:type]
47
+
48
+ image = options[:latest] ? { type: options[:type], name: :latest } : options[:name].to_sym
49
+ Linecook::ImageManager.fetch(image)
44
50
  end
45
51
 
46
52
  desc 'clean', 'Clean up cached images'
@@ -1,3 +1,3 @@
1
1
  module Linecook
2
- VERSION = '0.5.8'
2
+ VERSION = '0.5.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linecook-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Hamel