Class: Dash::Cli::Lock

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

Constant Summary

Constants inherited from Base

Base::AUTOMATIC_DEPLOY_LOCK_MESSAGE, Base::HOOK_MUTEX, Base::VERBOSITY

Instance Method Summary collapse

Methods inherited from Base

dynamic_command_class, exit_on_failure?, #initialize

Constructor Details

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

Instance Method Details

#acquireObject



16
17
18
19
20
21
22
23
# File 'lib/dash/cli/lock.rb', line 16

def acquire
  ensure_run_directory

  raise_if_locked do
    execute_lock_acquire(options[:message])
    say "Acquired the deploy lock"
  end
end

#releaseObject



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/dash/cli/lock.rb', line 27

def release
  if options[:server]
    release_server_lock_on(server_lock_hosts)
    say "Released the server lock"
  else
    handle_missing_lock do
      execute_lock_release
      say "Released the deploy lock"
    end
  end
end

#statusObject



4
5
6
7
8
9
10
11
12
# File 'lib/dash/cli/lock.rb', line 4

def status
  if options[:server]
    report_server_lock_status
  else
    handle_missing_lock do
      puts capture_lock_status
    end
  end
end