class ECSHelper::Command::ExportImages
Public Instance Methods
cmd_option_parser()
click to toggle source
# File lib/ecs_helper/command/export_images.rb, line 5 def cmd_option_parser options = {} parser = ::OptionParser.new do |opts| opts.banner = "Usage: ecs_helper export_images" end [parser, options] end
required()
click to toggle source
# File lib/ecs_helper/command/export_images.rb, line 13 def required [] end
run()
click to toggle source
# File lib/ecs_helper/command/export_images.rb, line 17 def run puts export_images end
Private Instance Methods
application()
click to toggle source
# File lib/ecs_helper/command/export_images.rb, line 27 def application helper.application end
export_images()
click to toggle source
# File lib/ecs_helper/command/export_images.rb, line 31 def export_images variables = (['export'] + client.private_repositories.map do |repo| container_name = repo.repository_name.scan(/#{project}-#{application}-(.*)/).flatten.first next if container_name.nil? key = container_name.upcase.gsub("-", "_") + "_IMAGE" value = "#{repo.repository_uri}:#{helper.version}" "#{key}=#{value}" end).join(' ') variables end
project()
click to toggle source
# File lib/ecs_helper/command/export_images.rb, line 23 def project helper.project end