Class: Moku::Task::Upload

Inherits:
Task
  • Object
show all
Defined in:
lib/moku/task/upload.rb

Overview

Upload the artifact

Instance Method Summary collapse

Methods inherited from Task

#to_s

Constructor Details

#initialize(runner: Moku.system_runner, upload_factory: Moku.upload_factory) ⇒ Upload

Returns a new instance of Upload.


11
12
13
14
# File 'lib/moku/task/upload.rb', line 11

def initialize(runner: Moku.system_runner, upload_factory: Moku.upload_factory)
  @runner = runner
  @upload_factory = upload_factory
end

Instance Method Details

#call(release) ⇒ Object


16
17
18
19
20
21
# File 'lib/moku/task/upload.rb', line 16

def call(release)
  Sequence.for(release.sites.hosts) do |host|
    upload_factory.new(release.path, host, release.deploy_path)
      .with(runner)
  end
end