Class: Litterbox::Habitat::Export
- Inherits:
-
Object
- Object
- Litterbox::Habitat::Export
- Defined in:
- lib/litterbox/habitat/export.rb
Overview
Habitat upload
Instance Method Summary collapse
-
#initialize(pkg, exporter = 'docker') ⇒ Export
constructor
A new instance of Export.
- #upload(pkg = @pkg, exporter = @exporter) ⇒ Object
Constructor Details
#initialize(pkg, exporter = 'docker') ⇒ Export
Returns a new instance of Export.
7 8 9 10 |
# File 'lib/litterbox/habitat/export.rb', line 7 def initialize(pkg, exporter = 'docker') @pkg = pkg @exporter = exporter end |
Instance Method Details
#upload(pkg = @pkg, exporter = @exporter) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/litterbox/habitat/export.rb', line 12 def upload(pkg = @pkg, exporter = @exporter) raise 'file artifact not found' unless File.exist?(pkg) Open3.popen3("hab pkg export #{exporter} #{pkg}") do |_, out, _, thr| while (line = out.gets) puts(line) end return thr.value end end |