Class: Kamal::Cli::Lock

Inherits:
Base
  • Object
show all
Defined in:
lib/kamal/cli/lock.rb

Instance Method Summary collapse

Methods inherited from Base

dynamic_command_class, exit_on_failure?, #initialize

Constructor Details

This class inherits a constructor from Kamal::Cli::Base

Instance Method Details

#acquireObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/kamal/cli/lock.rb', line 13

def acquire
  message = options[:message]
  ensure_run_directory

  raise_if_locked do
    on(KAMAL.primary_host) do
      execute *KAMAL.lock.acquire(message, KAMAL.config.version), verbosity: :debug
    end
    say "Acquired the deploy lock"
  end
end

#releaseObject



26
27
28
29
30
31
32
33
# File 'lib/kamal/cli/lock.rb', line 26

def release
  handle_missing_lock do
    on(KAMAL.primary_host) do
      execute *KAMAL.lock.release, verbosity: :debug
    end
    say "Released the deploy lock"
  end
end

#statusObject



3
4
5
6
7
8
9
# File 'lib/kamal/cli/lock.rb', line 3

def status
  handle_missing_lock do
    on(KAMAL.primary_host) do
      puts capture_with_debug(*KAMAL.lock.status)
    end
  end
end