Class: Bozo::Preparers::ServiceDiagnosticsAssemblyInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/bozo/preparers/service_diagnostics_assembly_info.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/bozo/preparers/service_diagnostics_assembly_info.rb', line 9

def execute
  log_info 'Generating service diagnostics assembly info'

  git_hash = env['GIT_HASH_FULL']
  computer_name = env['COMPUTERNAME']
  path = File.expand_path(File.join('build', 'ServiceDiagnosticsAssemblyInfo.cs'))
  build_url = env['BUILD_URL']
  repo_url = `git config --get remote.origin.url`.strip
  team_email = @support_email

  log_debug "Commit hash: #{git_hash}"
  log_debug "Computer name: #{computer_name}" if computer_name
  log_debug "Build url: #{build_url}"
  log_debug "Repo url: #{repo_url}"
  log_debug "Team email: #{team_email}"
  log_debug "Path: #{path}"

  File.open(path, 'w+') do |f|
    f << "[assembly: Zopa.ServiceDiagnostics.ProjectInformation(\"#{repo_url}\", \"#{team_email}\")]\n"
    f << "[assembly: Zopa.ServiceDiagnostics.BuildInformation(\"#{git_hash}\", \"#{Time.now}\", \"#{computer_name}\", \"#{build_url}\")]"
  end
end

#support_email(name) ⇒ Object



5
6
7
# File 'lib/bozo/preparers/service_diagnostics_assembly_info.rb', line 5

def support_email(name)
  @support_email = name
end