Class: Mrsk::Commands::Lock

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

Constant Summary

Constants inherited from Base

Base::DOCKER_HEALTH_LOG_FORMAT, Base::DOCKER_HEALTH_STATUS_FORMAT

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#container_id_for, #initialize, #run_over_ssh

Constructor Details

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

Instance Method Details

#acquire(message, version) ⇒ Object



5
6
7
8
9
# File 'lib/mrsk/commands/lock.rb', line 5

def acquire(message, version)
  combine \
    [:mkdir, lock_dir],
    write_lock_details(message, version)
end

#releaseObject



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

def release
  combine \
    [:rm, lock_details_file],
    [:rm, "-r", lock_dir]
end

#statusObject



17
18
19
20
21
# File 'lib/mrsk/commands/lock.rb', line 17

def status
  combine \
    stat_lock_dir,
    read_lock_details
end