Artifactory-Client
view release on metacpan or search on metacpan
my $path = '/foo'; # path on artifactory
# Properties are a hashref of key-arrayref pairs. Note that value must be an arrayref even for a single element.
# This is to conform with Artifactory which treats property values as a list.
my $properties = {
one => ['two'],
baz => ['three'],
};
my $file = '/local/file.xml';
# Name of methods are taken straight from Artifactory REST API documentation. 'Deploy Artifact' would map to
# deploy_artifact method, like below. The caller gets HTTP::Response object back.
my $resp = $client->deploy_artifact( path => $path, properties => $properties, file => $file );
# Custom requests can also be made via usual get / post / put / delete requests.
my $resp = $client->get( 'http://artifactory.server.com/path/to/resource' );
# Repository override for calls that have a repository in the endpoint. The passed-in repository will not persist.
my $resp = $client->calculate_yum_repository_metadata( repository => 'different_repo', async => 1 );
# Dev Env Setup / Running Tests
carton install
# to run unit tests
prove -r t
# GENERIC METHODS
## get( @args )
Invokes GET request on LWP::UserAgent-like object; params are passed through.
## post( @args )
nvokes POST request on LWP::UserAgent-like object; params are passed through.
## put( @args )
Invokes PUT request on LWP::UserAgent-like object; params are passed through.
## delete( @args )
Invokes DELETE request on LWP::UserAgent-like object; params are passed
through.
## request( @args )
Invokes request() on LWP::UserAgent-like object; params are passed through.
# BUILDS
## all\_builds
Retrieves information on all builds from artifactory.
## build\_runs( $build\_name )
Retrieves information of a particular build from artifactory.
## build\_upload( $path\_to\_json )
Upload Build
## build\_info( $build\_name, $build\_number )
Retrieves information of a particular build number.
## builds\_diff( $build\_name, $new\_build\_number, $old\_build\_number )
Retrieves diff of 2 builds
## build\_promotion( $build\_name, $build\_number, $payload )
Promotes a build by POSTing payload
## promote\_docker\_image( targetRepo => "target\_repo", dockerRepository => "dockerRepository", tag => "tag", copy => 'false' )
Promotes a Docker image from one repository to another
## delete\_builds( name => $build\_name, buildnumbers => \[ buildnumbers \], artifacts => 0,1, deleteall => 0,1 )
Removes builds stored in Artifactory. Useful for cleaning up old build info data
## build\_rename( $build\_name, $new\_build\_name )
Renames a build
## distribute\_build( 'build\_name', $build\_number, %hash\_of\_json\_payload )
Deploys builds from Artifactory to Bintray, and creates an entry in the corresponding Artifactory distribution
repository specified.
## control\_build\_retention( 'build\_name', deleteBuildArtifacts => 'true', count => 100, ... )
Specifies retention parameters for build info.
# ARTIFACTS & STORAGE
## folder\_info( $path )
Returns folder info
## file\_info( $path )
Returns file info
## get\_storage\_summary\_info
Returns storage summary information regarding binaries, file store and repositories
## item\_last\_modified( $path )
Returns item\_last\_modified for a given path
## file\_statistics( $path )
Returns file\_statistics for a given path
## item\_properties( path => $path, properties => \[ key\_names \] )
( run in 0.938 second using v1.01-cache-2.11-cpan-b16cb0d3907 )