Class: DockerCompose
- Inherits:
-
Object
- Object
- DockerCompose
- Defined in:
- lib/container_management/docker_compose.rb
Class Method Summary collapse
- .generate_yaml(dist_file_path, app_name, duty, port, image) ⇒ Object
- .pull_containers(project_name, compose_file) ⇒ Object
- .start_containers(project_name, compose_file) ⇒ Object
- .stop_containers(project_name, compose_file) ⇒ Object
Class Method Details
.generate_yaml(dist_file_path, app_name, duty, port, image) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/container_management/docker_compose.rb', line 3 def self.generate_yaml(dist_file_path, app_name, duty, port, image) branch = `git rev-parse --abbrev-ref HEAD`.strip commit = `git rev-parse --short HEAD`.strip path = File.dirname(dist_file_path) filename = "#{path}/#{app_name}-#{branch}-#{commit}_#{duty}.yaml" dist = File.read(dist_file_path) dist = dist.gsub('<port>', port.to_s) dist = dist.gsub('<image>', image) out_file = File.new(filename, 'w') out_file.puts(dist) out_file.close puts "Generated: #{filename} \n Contents: #{dist}" return out_file end |
.pull_containers(project_name, compose_file) ⇒ Object
23 24 25 |
# File 'lib/container_management/docker_compose.rb', line 23 def self.pull_containers(project_name, compose_file) end |
.start_containers(project_name, compose_file) ⇒ Object
31 32 33 |
# File 'lib/container_management/docker_compose.rb', line 31 def self.start_containers(project_name, compose_file) end |
.stop_containers(project_name, compose_file) ⇒ Object
27 28 29 |
# File 'lib/container_management/docker_compose.rb', line 27 def self.stop_containers(project_name, compose_file) end |