Class: Kamal::Cli::App::Boot

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, role, sshkit, version, barrier) ⇒ Boot

Returns a new instance of Boot.



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

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

Instance Attribute Details

#barrierObject (readonly)

Returns the value of attribute barrier.



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

def barrier
  @barrier
end

#hostObject (readonly)

Returns the value of attribute host.



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

def host
  @host
end

#roleObject (readonly)

Returns the value of attribute role.



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

def role
  @role
end

#sshkitObject (readonly)

Returns the value of attribute sshkit.



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

def sshkit
  @sshkit
end

#versionObject (readonly)

Returns the value of attribute version.



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

def version
  @version
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/kamal/cli/app/boot.rb', line 14

def run
  old_version = old_version_renamed_if_clashing

  wait_at_barrier if queuer?

  begin
    start_new_version
  rescue => e
    close_barrier if gatekeeper?
    stop_new_version
    raise
  end

  release_barrier if gatekeeper?

  if old_version
    stop_old_version(old_version)
  end
end