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 +4 -4
- data/lib/linecook/builder/build.rb +1 -0
- data/lib/linecook/cli.rb +10 -4
- data/lib/linecook/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fdef146633a6fad22b7e806afbdca1aa36a7b60
|
4
|
+
data.tar.gz: 983c91824d7525b3d7b20dab8ce8b97945e85dde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
41
|
-
|
42
|
-
|
43
|
-
|
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'
|
data/lib/linecook/version.rb
CHANGED