Class: Jenkins2API::Endpoint::Artifact

Inherits:
BaseEndpoint show all
Defined in:
lib/endpoints/artifact.rb

Overview

This class contains all the calls to reach Jenkins2 and obtain Artifact data

Instance Method Summary collapse

Methods inherited from BaseEndpoint

#initialize

Constructor Details

This class inherits a constructor from Jenkins2API::Endpoint::BaseEndpoint

Instance Method Details

#all(name, build_id) ⇒ Object

Returns a list of all artifacts for a specific build

Params:

name

Job name

build_id

ID of the build



13
14
15
# File 'lib/endpoints/artifact.rb', line 13

def all(name, build_id)
  @client.build.get(name, build_id)['artifacts']
end

#get(name, build_id, artifact) ⇒ Object

Download a specific artifact.

Params:

name

Job name

build_id

ID of the build

artifact

artifact Hash.

This function uses only the relativePath property

Returns with the content of the artifact



26
27
28
29
30
31
32
# File 'lib/endpoints/artifact.rb', line 26

def get(name, build_id, artifact)
  @client.api_request(
    :get,
    "/job/#{name}/#{build_id}/artifact/#{artifact['relativePath']}",
    :raw
  )
end