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.
227 228 229 230 231 232 233 234 235 236 |
# File 'lib/dc.rb', line 227 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.
238 239 240 |
# File 'lib/dc.rb', line 238 def group @group end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
238 239 240 |
# File 'lib/dc.rb', line 238 def images @images end |
Instance Method Details
#containers ⇒ Object
240 241 242 |
# File 'lib/dc.rb', line 240 def containers group.containers end |
#rebuild_images ⇒ Object
249 250 251 252 253 254 |
# File 'lib/dc.rb', line 249 def rebuild_images images.each do |image| image.tag "before_rebuild.#{Time.now.to_i}" image.build end end |
#run ⇒ Object
244 245 246 247 |
# File 'lib/dc.rb', line 244 def run build_images prepare_services end |