Class: DC::Project
- Inherits:
-
Object
- Object
- DC::Project
- Defined in:
- lib/dc.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
Instance Method Summary collapse
- #containers ⇒ Object
-
#initialize(directory: '.', docker_socket: 'tcp://127.0.0.1:2375') ⇒ Project
constructor
A new instance of Project.
- #rebuild_images ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(directory: '.', docker_socket: 'tcp://127.0.0.1:2375') ⇒ Project
Returns a new instance of Project.
209 210 211 212 213 214 215 216 217 218 |
# File 'lib/dc.rb', line 209 def initialize directory: '.', docker_socket: 'tcp://127.0.0.1:2375' check_if_docker_is_available_at docker_socket @directory = File. directory @images_directory = "#{@directory}/.docker/images" @images = prepare_images @services_file = "#{@directory}/.docker/services.yml" end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
220 221 222 |
# File 'lib/dc.rb', line 220 def group @group end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
220 221 222 |
# File 'lib/dc.rb', line 220 def images @images end |
Instance Method Details
#containers ⇒ Object
222 223 224 |
# File 'lib/dc.rb', line 222 def containers group.containers end |
#rebuild_images ⇒ Object
231 232 233 234 235 236 |
# File 'lib/dc.rb', line 231 def rebuild_images images.each do |image| image.tag "before_rebuild.#{Time.now.to_i}" image.build end end |
#run ⇒ Object
226 227 228 229 |
# File 'lib/dc.rb', line 226 def run build_images prepare_services end |