Sha256: afe3e0289db573d4a4c73662832853aa0715d79d4b6ca0e8be5cc13537dfdd98

Contents?: true

Size: 1.09 KB

Versions: 4

Compression:

Stored size: 1.09 KB

Contents

module Bozo::Preparers

  class ServiceDiagnosticsAssemblyInfo

    def support_email(name)
      @support_email = name
    end

    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

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bozo-scripts-0.18.5 lib/bozo/preparers/service_diagnostics_assembly_info.rb
bozo-scripts-0.18.4 lib/bozo/preparers/service_diagnostics_assembly_info.rb
bozo-scripts-0.18.3 lib/bozo/preparers/service_diagnostics_assembly_info.rb
bozo-scripts-0.18.2 lib/bozo/preparers/service_diagnostics_assembly_info.rb