Class: UffizziCore::Api::Cli::V1::ProjectSerializer

Inherits:
BaseSerializer
  • Object
show all
Defined in:
app/serializers/uffizzi_core/api/cli/v1/project_serializer.rb

Instance Method Summary collapse

Instance Method Details

#default_composeObject



15
16
17
# File 'app/serializers/uffizzi_core/api/cli/v1/project_serializer.rb', line 15

def default_compose
  object.compose_files.main.first
end

#deploymentsObject



19
20
21
22
23
24
25
26
27
28
# File 'app/serializers/uffizzi_core/api/cli/v1/project_serializer.rb', line 19

def deployments
  object.deployments.active.map do |deployment|
    deployment.state = if UffizziCore::DeploymentService.failed?(deployment)
      UffizziCore::Deployment::STATE_FAILED
    else
      UffizziCore::Deployment::STATE_ACTIVE
    end
    deployment
  end
end

#secretsObject



30
31
32
33
34
# File 'app/serializers/uffizzi_core/api/cli/v1/project_serializer.rb', line 30

def secrets
  return [] unless object.secrets

  object.secrets.map(&:name)
end