Class: Cody::CLI::Badge

Inherits:
Base
  • Object
show all
Defined in:
lib/cody/cli/badge.rb

Instance Method Summary collapse

Methods inherited from Base

#build_id, #check_build_id!, #initialize, #run_with_exception_handling

Methods included from AwsServices

#cfn, #codebuild

Methods included from AwsServices::Helpers

#are_you_sure?, #find_stack, #inferred_project_name, #inferred_stack_name, #normalize_stack_name, #project_name_convention, #stack_exists?

Constructor Details

This class inherits a constructor from Cody::CLI::Base

Instance Method Details

#runObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/cody/cli/badge.rb', line 3

def run
  resp = codebuild.batch_get_projects(names: [@full_project_name])
  project = resp.projects.first
  unless project
    puts "Project not found: #{@full_project_name}"
    return
  end

  url = project.badge.badge_request_url
  if @options[:markdown]
    puts "![CodeBuild](#{url})"
  else
    puts url
  end
end