Sha256: c87d0d9bd120ed1e97eb0357d29229fc0cf9d8cd74c9d71974c06700c8538af3

Contents?: true

Size: 644 Bytes

Versions: 1

Compression:

Stored size: 644 Bytes

Contents

module TestBoosters
  module InsightsUploader
    module_function

    def upload(booster_type, file)
      return unless ENV['TB_UPLOAD_INSIGHTS']

      cmd = "http POST '#{insights_url}' #{booster_type}:=@#{file}"

      TestBoosters::Shell.execute("#{cmd} > ~/insights_uploader.log", :silent => true)
    end

    def insights_url
      params = {
        :project_hash_id => ENV["SEMAPHORE_PROJECT_UUID"],
        :build_hash_id => ENV["SEMAPHORE_EXECUTABLE_UUID"],
        :job_hash_id => ENV["SEMAPHORE_JOB_UUID"]
      }

      "https://insights-receiver.semaphoreci.com/job_reports?#{::URI.encode_www_form(params)}"
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
treye-semaphore_test_boosters-2.5.2 lib/test_boosters/insights_uploader.rb