Class: Buildkite::Artifact

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

Class Method Summary collapse

Methods inherited from Object

#initialize, #to_ostruct

Constructor Details

This class inherits a constructor from Buildkite::Object

Class Method Details

.delete(org: Buildkite.config.org, pipeline: Buildkite.config.pipeline, build:, job:, id:) ⇒ Object



26
27
28
# File 'lib/buildkite/models/artifact.rb', line 26

def delete(org: Buildkite.config.org, pipeline: Buildkite.config.pipeline, build:, job:, id:)
  Client.delete_request("organizations/#{org}/pipelines/#{pipeline}/builds/#{build}/jobs/#{job}/artifacts/#{id}")
end

.download(org: Buildkite.config.org, pipeline: Buildkite.config.pipeline, build:, job:, id:) ⇒ Object



21
22
23
24
# File 'lib/buildkite/models/artifact.rb', line 21

def download(org: Buildkite.config.org, pipeline: Buildkite.config.pipeline, build:, job:, id:)
  response = Client.get_request("organizations/#{org}/pipelines/#{pipeline}/builds/#{build}/jobs/#{job}/artifacts/#{id}/download")
  ArtifactDownload.new response.body
end

.list(org: Buildkite.config.org, pipeline: Buildkite.config.pipeline, build:, job: nil) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/buildkite/models/artifact.rb', line 6

def list(org: Buildkite.config.org, pipeline: Buildkite.config.pipeline, build:, job: nil)
  if job
    response = Client.get_request("organizations/#{org}/pipelines/#{pipeline}/builds/#{build}/jobs/#{job}/artifacts")
  else
    response = Client.get_request("organizations/#{org}/pipelines/#{pipeline}/builds/#{build}/artifacts")
  end

  Collection.from_response(response, type: Artifact)
end

.retrieve(org: Buildkite.config.org, pipeline: Buildkite.config.pipeline, build:, job:, id:) ⇒ Object



16
17
18
19
# File 'lib/buildkite/models/artifact.rb', line 16

def retrieve(org: Buildkite.config.org, pipeline: Buildkite.config.pipeline, build:, job:, id:)
  response = Client.get_request("organizations/#{org}/pipelines/#{pipeline}/builds/#{build}/jobs/#{job}/artifacts/#{id}")
  Artifact.new response.body
end