Module: Stax::Ecr

Defined in:
lib/stax/mixin/ecr.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(thor) ⇒ Object



6
7
8
9
# File 'lib/stax/mixin/ecr.rb', line 6

def self.included(thor)
  thor.desc(:ecr, 'ECR subcommands')
  thor.subcommand(:ecr, Cmd::Ecr)
end

Instance Method Details

#ecr_registryObject



11
12
13
# File 'lib/stax/mixin/ecr.rb', line 11

def ecr_registry
  @_ecr_registry ||= "#{}.dkr.ecr.#{aws_region}.amazonaws.com"
end

#ecr_repositoriesObject



15
16
17
# File 'lib/stax/mixin/ecr.rb', line 15

def ecr_repositories
  @_ecr_repositories ||= Aws::Cfn.resources_by_type(stack_name, 'AWS::ECR::Repository')
end

#ecr_repository_nameObject

override to set an explicit repo name



24
25
26
# File 'lib/stax/mixin/ecr.rb', line 24

def ecr_repository_name
  @_ecr_repository_name ||= (ecr_repository_names&.first || app_name)
end

#ecr_repository_namesObject



19
20
21
# File 'lib/stax/mixin/ecr.rb', line 19

def ecr_repository_names
  @_ecr_repository_names ||= ecr_repositories.map(&:physical_resource_id)
end