Class: Image

Inherits:
Thor
  • Object
show all
Defined in:
lib/linecook-gem/cli.rb

Instance Method Summary collapse

Instance Method Details

#cleanObject


25
26
27
28
29
# File 'lib/linecook-gem/cli.rb', line 25

def clean
  opts = options.symbolize_keys
  image = Linecook::Image.new(opts[:name], opts[:group], nil)
  puts "Cleaned up #{image.clean(opts[:retention]).length} images"
end

#fetchObject


35
36
37
38
39
# File 'lib/linecook-gem/cli.rb', line 35

def fetch
  opts = options.symbolize_keys
  image = Linecook::Image.new(opts[:name], opts[:group], opts[:tag] )
  image.fetch
end

#keygenObject


7
8
9
# File 'lib/linecook-gem/cli.rb', line 7

def keygen
  puts Linecook::Crypto.keygen
end

#listObject


15
16
17
18
19
# File 'lib/linecook-gem/cli.rb', line 15

def list
  opts = options.symbolize_keys
  image = Linecook::Image.new(opts[:name], opts[:group], nil)
  puts image.list
end

#packageObject


57
58
59
60
61
# File 'lib/linecook-gem/cli.rb', line 57

def package
  opts = options.symbolize_keys
  image = Linecook::Image.new(opts[:name], opts[:group], opts[:tag])
  Linecook::Packager.package(image, name: opts[:strategy], directory: opts[:directory])
end

#saveObject


68
69
70
71
72
73
# File 'lib/linecook-gem/cli.rb', line 68

def save
  opts = options.symbolize_keys
  image = Linecook::Image.new(opts[:name], opts[:group], opts[:tag])
  baker = Linecook::Baker::Baker.new(image, directory: opts[:directory])
  baker.save
end

#uploadObject


45
46
47
48
49
# File 'lib/linecook-gem/cli.rb', line 45

def upload
  opts = options.symbolize_keys
  image = Linecook::Image.new(opts[:name], opts[:group], opts[:tag] )
  image.upload
end