class CircleCIReporter::Configuration

Constants

DEFAULT_REPORTERS
DEFAULT_VCS_TYPE

Attributes

artifacts_dir[W]
base_revision[W]
circleci_token[RW]
current_build_number[W]
current_revision[W]
previous_build_number[W]
reporters[W]
repository_name[W]
template[W]
template_safe_mode[W]
user_name[W]
vcs_token[RW]
vcs_type[W]

Public Instance Methods

artifacts_dir() click to toggle source

@return [String]

# File lib/circleci_reporter/configuration.rb, line 37
def artifacts_dir
  @artifacts_dir ||= ENV['CIRCLE_ARTIFACTS']
end
base_revision() click to toggle source

@return [String]

# File lib/circleci_reporter/configuration.rb, line 42
def base_revision
  @base_revision ||= `git merge-base origin/master HEAD`.strip
end
current_build_number() click to toggle source

@return [Integer]

# File lib/circleci_reporter/configuration.rb, line 47
def current_build_number
  @current_build_number ||= ENV['CIRCLE_BUILD_NUM']
end
current_revision() click to toggle source

@return [String]

# File lib/circleci_reporter/configuration.rb, line 52
def current_revision
  @current_revision ||= ENV['CIRCLE_SHA1']
end
dump() click to toggle source

@return [void]

# File lib/circleci_reporter/configuration.rb, line 72
    def dump
      puts <<~CONFIGURATION
        Configuration         | Value
        ----------------------|----------------------------------------------------------------------------
        artifacts_dir         | #{artifacts_dir.inspect}
        base_revision         | #{base_revision.inspect}
        circleci_token        | #{circleci_token[-4..].rjust(40, '*').inspect if circleci_token}
        current_build_number  | #{current_build_number.inspect}
        current_revision      | #{current_revision.inspect}
        previous_build_number | #{previous_build_number.inspect}
        reporters             | #{reporters.inspect}
        repository_name       | #{repository_name.inspect}
        user_name             | #{user_name.inspect}
        vcs_token             | #{vcs_token[-4..].rjust(40, '*').inspect if vcs_token}
        vcs_type              | #{vcs_type.inspect}
      CONFIGURATION
    end
previous_build_number() click to toggle source

@return [Integer, nil]

# File lib/circleci_reporter/configuration.rb, line 57
def previous_build_number
  @previous_build_number ||= ENV['CIRCLE_PREVIOUS_BUILD_NUM']&.to_i
end
project() click to toggle source

@return [String]

# File lib/circleci_reporter/configuration.rb, line 22
def project
  "#{user_name}/#{repository_name}"
end
reporters() click to toggle source

@return [Array<Reporters::Base>]

# File lib/circleci_reporter/configuration.rb, line 27
def reporters
  @reporters ||= DEFAULT_REPORTERS.dup
end
repository_name() click to toggle source

@return [String]

# File lib/circleci_reporter/configuration.rb, line 62
def repository_name
  @repository_name ||= ENV['CIRCLE_PROJECT_REPONAME']
end
user_name() click to toggle source

@return [String]

# File lib/circleci_reporter/configuration.rb, line 67
def user_name
  @user_name ||= ENV['CIRCLE_PROJECT_USERNAME']
end
vcs_type() click to toggle source

@return [String]

# File lib/circleci_reporter/configuration.rb, line 32
def vcs_type
  @vcs_type ||= DEFAULT_VCS_TYPE
end