Class: Devkitkat::Executor::Docker
- Inherits:
-
Object
- Object
- Devkitkat::Executor::Docker
- Defined in:
- lib/devkitkat/executor/docker.rb
Constant Summary collapse
- PreparationError =
Class.new(StandardError)
- ROOT_IN_CONTAINER =
'/devkitkat'
Instance Attribute Summary collapse
-
#script_file ⇒ Object
readonly
Returns the value of attribute script_file.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
- #cleanup ⇒ Object
- #commit(script_file) ⇒ Object
-
#initialize(service) ⇒ Docker
constructor
A new instance of Docker.
- #prepare ⇒ Object
Constructor Details
#initialize(service) ⇒ Docker
Returns a new instance of Docker.
15 16 17 |
# File 'lib/devkitkat/executor/docker.rb', line 15 def initialize(service) @service = service end |
Instance Attribute Details
#script_file ⇒ Object (readonly)
Returns the value of attribute script_file.
9 10 11 |
# File 'lib/devkitkat/executor/docker.rb', line 9 def script_file @script_file end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
9 10 11 |
# File 'lib/devkitkat/executor/docker.rb', line 9 def service @service end |
Instance Method Details
#cleanup ⇒ Object
25 26 27 |
# File 'lib/devkitkat/executor/docker.rb', line 25 def cleanup stop_container end |
#commit(script_file) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/devkitkat/executor/docker.rb', line 29 def commit(script_file) @script_file = script_file rewrite_root_path! new_path = script_path_in_container exec([new_path], user: user_name) end |
#prepare ⇒ Object
19 20 21 22 23 |
# File 'lib/devkitkat/executor/docker.rb', line 19 def prepare pull_image unless image_exist? start_container sync_user_with_host end |