Class: Mrsk::Cli::Lock

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

Instance Method Summary collapse

Methods inherited from Base

exit_on_failure?, #initialize

Constructor Details

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

Instance Method Details

#acquireObject



11
12
13
14
15
16
17
# File 'lib/mrsk/cli/lock.rb', line 11

def acquire
  message = options[:message]
  raise_if_locked do
    on(MRSK.primary_host) { execute *MRSK.lock.acquire(message, MRSK.config.version), verbosity: :debug }
    say "Acquired the deploy lock"
  end
end

#releaseObject



20
21
22
23
24
25
# File 'lib/mrsk/cli/lock.rb', line 20

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

#statusObject



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

def status
  handle_missing_lock do
    on(MRSK.primary_host) { puts capture_with_debug(*MRSK.lock.status) }
  end
end