Class: Artifact

Inherits:
Object
  • Object
show all
Defined in:
lib/buildkiq/artifact.rb

Instance Method Summary collapse

Constructor Details

#initialize(job) ⇒ Artifact

Returns a new instance of Artifact.



5
6
7
8
# File 'lib/buildkiq/artifact.rb', line 5

def initialize(job)
  @s3_client = Aws::S3::Client.new
  @job       = job
end

Instance Method Details

#find_by(path) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/buildkiq/artifact.rb', line 14

def find_by(path)
  io = if packaging_zip?
         fetch_zip_file.find_by_name(path)
       else
         fetch_s3_object("/#{path}")
       end

  io.read
end

#upload_success?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/buildkiq/artifact.rb', line 10

def upload_success?
  @job.artifact_upload_success?
end