Module: Neptuno::Docker::Services

Includes:
TTY::Config
Defined in:
lib/neptuno/docker/services.rb

Constant Summary

Constants included from TTY::Config

TTY::Config::ABORT_MESSAGE, TTY::Config::TTY

Constants included from TTY::File

TTY::File::ABORT_MESSAGE, TTY::File::TTY

Instance Method Summary collapse

Methods included from TTY::Config

#auto_restart_procs, #config, #configured_services, #docker_compose_hash, #docker_compose_services, #get_dependants, #healthy_services, #json_services_status, #services, #services_with_procs, #starting_services

Methods included from TTY::File

#file, #in_service?, #make_service_files, #neptuno_path, #project, #service

Instance Method Details

#registered_servicesObject



14
15
16
17
# File 'lib/neptuno/docker/services.rb', line 14

def registered_services
  dc = YAML.load_file("#{neptuno_path}/docker-compose.yml")
  dc["services"].keys
end

#running_servicesObject



9
10
11
12
# File 'lib/neptuno/docker/services.rb', line 9

def running_services
  running_services = `cd ~/.neptuno/projects/#{current_project} && docker compose ps | awk '{ print $3 }' | awk 'NR>1'`
  running_services.split("\n").map(&:strip)
end

#stopped_servicesObject



19
20
21
# File 'lib/neptuno/docker/services.rb', line 19

def stopped_services
  registered_services - running_services
end