class Artifactory::Resource::Artifact

Included Modules

Extended Modules

Defined in:

artifactory/resources/artifact.cr

Constant Summary

CHECKSUM_SEARCH_URL = "artifactory/api/search/checksum"
FETCH_URL_BASE = "artifactory/storage"
PROP_SEARCH_URL = "artifactory/api/search/prop"
SEARCH_URL = "artifactory/api/search/artifact"

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Artifactory::Resource::Base

client : Artifactory::Client client, client=(client : Artifactory::Client) client=, to_s(io) to_s, url_safe(value) url_safe

Constructor Detail

def self.new(repo : String, path : String, local_path : String) #

[View source]
def self.new(pull : JSON::PullParser) #

Class Method Detail

def self.logger #

[View source]

Instance Method Detail

def checksums : Hash(String, String) #

[View source]
def checksums=(checksums : Hash(String, String)) #

[View source]
def copy(destination, **options) #

See #copy_or_move


[View source]
def copy_or_move(action, destination, **options) #

Copy or move current artifact to a new destination.

@example Move the current artifact to +ext-releases-local+ artifact.move(to: '/ext-releaes-local/org/acme') @example Copy the current artifact to +ext-releases-local+ artifact.move(to: '/ext-releaes-local/org/acme')

@param [Symbol] action the action (+:move+ or +:copy+) @param [String] destination the server-side destination to move or copy the artifact @param [Hash] options the list of options to pass

@option options [Boolean] :fail_fast (default: +false+) fail on the first failure @option options [Boolean] :suppress_layouts (default: +false+) suppress cross-layout module path translation during copying or moving @option options [Boolean] :dry_run (default: +false+) pretend to do the copy or move

@return [Hash] the parsed JSON response from the server


[View source]
def created : Time | Nil #

[View source]
def created=(created : Time | Nil) #

[View source]
def created_by : String | Nil #

[View source]
def created_by=(created_by : String | Nil) #

[View source]
def del_properties(*prop_names) #

[View source]
def delete #

Delete this artifact from repository, suppressing any +ResourceNotFound+ exceptions might occur.


[View source]
def download_uri : String | Nil #

[View source]
def download_uri=(download_uri : String | Nil) #

[View source]
def get_contents #

[View source]
def last_modified : Time | Nil #

[View source]
def last_modified=(last_modified : Time | Nil) #

[View source]
def last_updated : Time | Nil #

[View source]
def last_updated=(last_updated : Time | Nil) #

[View source]
def local_path : String | Nil #

[View source]
def local_path=(local_path : String | Nil) #

[View source]
def logger #

[View source]
def md5 #

The MD5 of this artifact.


[View source]
def mime_type : String | Nil #

[View source]
def mime_type=(mime_type : String | Nil) #

[View source]
def modified_by : String | Nil #

[View source]
def modified_by=(modified_by : String | Nil) #

[View source]
def move(destination, **options) #

See #copy_or_move


[View source]
def original_checksums : Hash(String, String) #

[View source]
def original_checksums=(original_checksums : Hash(String, String)) #

[View source]
def path : String #

[View source]
def path=(path : String) #

[View source]
def properties : Hash(String, JSON::Any) #

GET /api/storage/libs-release-local/org/acme?properties[=x[,y]] { "uri": "http://localhost:8081/artifactory/api/storage/libs-release-local/org/acme" "properties":{ "p1": ["v1","v2","v3"], "p2": ["v4","v5","v6"] } }


[View source]
def relative_path #

Helper method for extracting the relative (repo) path, since it's not returned as part of the API.

@example Get the relative URI from the resource /libs-release-local/org/acme/artifact.deb

@return [String]


[View source]
def replace_properties(new_properties : Hash(String, String) = Hash(String, String).new, **props) #

[View source]
def repo : String #

[View source]
def repo=(repo : String) #

[View source]
def sha1 #

The SHA of this artifact.


[View source]
def sha256 #

[View source]
def size : String #

[View source]
def size=(size : String) #

[View source]
def update_properties(new_properties : Hash(String, String) = Hash(String, String).new, **props) #

[View source]
def upload(repo : String | Nil = nil, remote_path : String | Nil = nil, headers : Hash(String, String) = Hash(String, String).new, properties : Hash(String, String) = Hash(String, String).new, **props) #

Upload an artifact into the repository. If the first parameter is a File object, that file descriptor is passed to the uploader. If the first parameter is a string, it is assumed to be the path to a local file on disk. This method will automatically construct the File object from the given path.

@see bit.ly/1dhJRMO Artifactory Matrix Properties

@example Upload an artifact from a File instance artifact = Artifact.new(local_path: '/local/path/to/file.deb') artifact.upload('libs-release-local', '/remote/path')

@example Upload an artifact with matrix properties artifact = Artifact.new(local_path: '/local/path/to/file.deb') artifact.upload('libs-release-local', "/remote/path", status: 'DEV', rating: 5, branch: 'master' )

@param [String] repo the key of the repository to which to upload the file @param [String] remote_path the path where this resource will live in the remote artifactory repository, relative to the repository key @param [Hash] headers the list of headers to send with the request @param [Hash] properties a list of matrix properties


[View source]
def uri : String | Nil #

[View source]
def uri=(uri : String | Nil) #

[View source]