class HyperDock::Resource::ProjectService

Constants

PROJECT_LABEL
SERVICE_LABEL

Public Instance Methods

attributes() click to toggle source
# File lib/hyperdock/resource/project_service.rb, line 53
def attributes
  { name: service }
end
containers() click to toggle source
# File lib/hyperdock/resource/project_service.rb, line 26
def containers
  @containers ||= ::Docker::Container.all.select do |container|
    matches_project?(container) && matches_service?(container)
  end
end
matches_project?(container) click to toggle source
# File lib/hyperdock/resource/project_service.rb, line 18
def matches_project?(container)
  container.info.dig('Labels', PROJECT_LABEL) == project
end
matches_service?(container) click to toggle source
# File lib/hyperdock/resource/project_service.rb, line 22
def matches_service?(container)
  container.info.dig('Labels', SERVICE_LABEL) == service
end
project() click to toggle source
# File lib/hyperdock/resource/project_service.rb, line 10
def project
  @project ||= request.path_info[:project]
end
service() click to toggle source
# File lib/hyperdock/resource/project_service.rb, line 14
def service
  @service ||= request.path_info[:service]
end