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
|