Class: Kamal::Cli::App::PrepareAssets

Inherits:
Object
  • Object
show all
Defined in:
lib/kamal/cli/app/prepare_assets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, role, sshkit) ⇒ PrepareAssets

Returns a new instance of PrepareAssets.



6
7
8
9
10
# File 'lib/kamal/cli/app/prepare_assets.rb', line 6

def initialize(host, role, sshkit)
  @host = host
  @role = role
  @sshkit = sshkit
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



2
3
4
# File 'lib/kamal/cli/app/prepare_assets.rb', line 2

def host
  @host
end

#roleObject (readonly)

Returns the value of attribute role.



2
3
4
# File 'lib/kamal/cli/app/prepare_assets.rb', line 2

def role
  @role
end

#sshkitObject (readonly)

Returns the value of attribute sshkit.



2
3
4
# File 'lib/kamal/cli/app/prepare_assets.rb', line 2

def sshkit
  @sshkit
end

Instance Method Details

#runObject



12
13
14
15
16
17
18
# File 'lib/kamal/cli/app/prepare_assets.rb', line 12

def run
  if assets?
    execute *app.extract_assets
    old_version = capture_with_info(*app.current_running_version, raise_on_non_zero_exit: false).strip
    execute *app.sync_asset_volumes(old_version: old_version)
  end
end