zipfiles should work. I don't think executables and isos are supported though. Their documentation says "Supported archive types are: zip; tar; tar.gz; and tgz".
With that said, here is the test on deploy_artifact() method call that I tested with a zipfile that contains httpd RPM.
1. Before the test, checking the md5sum
$ md5sum httpd.zip
25cebfcb7641123f0c5cb508587de571 httpd.zip
2. here is my test script that uploads this zip file, then download it, write as a different file:
#!/usr/bin/perl
use strict;
use warnings;
use Artifactory::Client;
my $args = {
artifactory => '
http://localhost',
port => 8081,
repository => 'test',
};
my $client = Artifactory::Client->new( $args );
$client->deploy_artifact( path => '/test.zip', file => 'httpd.zip' );
my $resp = $client->retrieve_artifact( '/test.zip' );
my $content = $resp->decoded_content;
open( my $fh, ">:raw", 'foobar.zip' );
print $fh $content;
close $fh;
3. Now, let's check the md5sum of foobar.zip
$ md5sum foobar.zip
25cebfcb7641123f0c5cb508587de571 foobar.zip
As you can see, I uploaded a file from local to artifactory then downloaded it as a different file and md5sum matches just fine.
I remember asking you to save the file using the raw filehandle mode as shown above. If you don't do that, md5sum might be different - that's not a bug with my module but with the way Perl handles binary data.
Regarding the deploy_artifacts_from_archive() call, I think the evidence is pretty clear that artifactory doesn't like the authentication. If it is really allowing the anonymous access, you shouldn't be seeing HTTP response 401 at all. Make sure that 'deploy' permission is set on the repository as the documentation describes: "Security: Requires a user with 'deploy' permissions (can be anonymous)"
On Tue Jul 15 13:12:39 2014, victor_diec@mitel.com wrote:
Show quoted text> The file that I am uploading is a zip file. I have tried this on
> executables, isos and tars as well. It always produces a different
> checksum and I am not sure what's going on. I am calling the
> deploy_artifact() method on your perl module when getting the
> incorrect
> checksum.
>
> I tried to deploy_artfacts_from_archive() subroutine when Anonymous
> access
> was on and the dumper result was basically the same. I do not think
> basic
> authorization is the issue because that should affect the other
> modules? I
> provide the perl module with admin credentials and all other methods
> that
> require authentication work fine from what I recall but I am not
> entirely
> sure.
>
> I will take a look at the basic authentication if you believe that is
> the
> problem though.
>
>
>
>
>
>
> On 15 July 2014 00:13, Satoshi Yagi via RT <
> bug-Artifactory-Client@rt.cpan.org> wrote:
>
> > <URL:
https://rt.cpan.org/Ticket/Display.html?id=96924 >
> >
> > Regarding the archive exploding issue:
> >
> > It seems that the authentication is failing as I see '401
> > Authentication
> > is required' message below.
> >
> > The actual HTTP request is being made with 'x-explode-archive' =>
> > 'true'
> > as shown below.
> >
> > You might want to try allowing anonymous access to your repository
> > then
> > make the same request to see what happens.
> >
> > '_content' => '{
> > "errors" : [ {
> > "status" : 401,
> > "message" : "Authentication is required."
> > } ]
> > }',
> > '_rc' => '401',
> > '_msg' => 'Unauthorized',
> > '_request' => bless( {
> > '_content'
> > => sub { "DUMMY" },
> > '_uri' =>
> > bless( do{\(my $o = '
> >
http://10.44.23.201:8081/artifactory/libs-release-local/using
> >
> >
> > 'user-agent' => 'libwww-perl/6.05',
> >
> > 'x-explode-archive' => 'true',
> >
> > If basic authentication is required, see the following sample on how
> > to
> > configure it. My module would uses LWP::UserAgent by default.
> >
> >
> >
http://stackoverflow.com/questions/8203964/lwpuseragent-http-basic-
> > authentication
> >
> > On Tue Jul 15 00:03:23 2014, SYAGI wrote:
> > > Victor,
> > >
> > > Thanks for dumping the response object. I'll look at it and see
> > > what
> > > I can find out.
> > >
> > > On the checksum issue, what kind of artifact are you uploading? Is
> > > it
> > > a text file or binary file? Are you using the deploy_artifact()
> > > method call?
> > >
> > > We can keep both issues on this bug. If you are calling
> > > deploy_artifact() method, I should be able to test it locally as it
> > > is
> > > supported in free version.
> > >
> > > On Mon Jul 14 11:37:44 2014, victor_diec@mitel.com wrote:
> > > > Hello Satoshi,
> > > >
> > > > I have attached a text file that contains the dump of my "$resp"
> > > > object.
> > > > My call to your perl module looks like this:
> > > >
> > > > $hash = $client->deploy_artifacts_from_archive(path =>
> > > > "/using_art_client/",file =>
> > > > "C:/Users/diecv/Downloads/csm_patch_6.0.2.8_13.zip"); #34.6MB
> > > > print Dumper($hash);
> > > >
> > > > After running this code, I looked through the UI to see what
> > > > changes
> > > > had
> > > > been made through the repository and only a directory with the
> > > > name
> > > > "using-art_client" was made.
> > > >
> > > > I also noticed another bug in your perl module. When deploying
> > > > artifacts
> > > > to Artifactory using your perl module, its checksum is different
> > > > than
> > > > the
> > > > original checksum on my file system. However, when I deploy the
> > > > same
> > > > artifact through the UI, its checksum matches the original. I
> > > > will
> > > > open
> > > > another bug report if you would like but I just noticed the error
> > > > recently.
> > > >
> > > >
> > > > Once again, I thank you providing me the opportunity to use the
> > > > perl
> > > > module
> > > > and hope you keep up the good work!
> > > >
> > > >
> > > > On 12 July 2014 00:12, Satoshi Yagi via RT <
> > > > bug-Artifactory-Client@rt.cpan.org> wrote:
> > > >
> > > > > <URL:
https://rt.cpan.org/Ticket/Display.html?id=96924 >
> > > > >
> > > > > I installed a free version of Artifactory on my local machine
> > > > > then
> > > > > started
> > > > > playing with it.
> > > > > I tested deploy_artifact function on httpd RPM for Fedora and
> > > > > upload
> > > > > /
> > > > > download worked fine.
> > > > >
> > > > > However, it turned out the deploy_artifacts_from_archive
> > > > > feature
> > > > > requires
> > > > > Artifactory Pro - which I no longer have access to.
> > > > >
> > > > > Here is a snippet of what should have been my test script:
> > > > >
> > > > > my $client = Artifactory::Client->new( $args );
> > > > > my $path = '/something.zip';
> > > > > my $resp = $client->deploy_artifacts_from_archive( path =>
> > > > > '/something.zip', file => 'something.zip' );
> > > > >
> > > > > If you'd like me to troubleshoot further, please dump the $resp
> > > > > object so
> > > > > that I can gain more insights on what's going on (PLEASE remove
> > > > > confidential bits for your employer, such as cookie info,
> > > > > server
> > > > > name
> > > > > etc).
> > > > >
> > > > > On Thu Jul 10 12:18:21 2014, SYAGI wrote:
> > > > > > Planning to look at this this weekend; I just changed job and
> > > > > > super
> > > > > > busy learning the new environment.
> > > > > >
> > > > > > On Mon Jul 07 23:58:45 2014, SYAGI wrote:
> > > > > > > Hi,
> > > > > > >
> > > > > > > Your usage seems fine.
> > > > > > > All I'm doing is adding X-Explode-Archive: true to the
> > > > > > > header
> > > > > > > then
> > > > > > > making a request.
> > > > > > >
> > > > > > > With that said, let me set up a custom instance and confirm
> > > > > > > this
> > > > > > > bug
> > > > > > > then see what I can do. I wonder if it could be some issue
> > > > > > > with
> > > > > > > reading a file on Windows, as my testing was done on linux.
> > > > > > >
> > > > > > > On Thu Jul 03 16:10:56 2014, victor_diec@mitel.com wrote:
> > > > > > > > I would like to report a bug/issue that I have been
> > > > > > > > experiencing
> > > > > > > > with
> > > > > > > > the
> > > > > > > > Artifactory-Client v0.7.4. When using:
> > > > > > > > deploy_artifacts_from_archive( path => $path, file =>
> > > > > > > > $file )
> > > > > > > >
> > > > > > > > I currently have tried:
> > > > > > > > $client->deploy_artifacts_from_archive(path =>
> > > > > > > > "/usingAPI/archive_blow_up/EntMgr_install_9_0_0_68.tar",file
> > > > > > > > =>
> > > > > > > > "C:/Users/diecv/Downloads/EntMgr_install_9_0_0_68.tar");
> > > > > > > > $client->deploy_artifacts_from_archive(path =>
> > > > > > > > "/usingAPI/archive_blow_up/EntMgr_install_9_0_0_68/",file
> > > > > > > > =>
> > > > > > > > "C:/Users/diecv/Downloads/EntMgr_install_9_0_0_68.tar");
> > > > > > > >
> > > > > > > > In the three cases, it was never unzipped. Am I giving
> > > > > > > > the
> > > > > > > > perl
> > > > > > > > module
> > > > > > > > incorrect information or information in the wrong format?
> > > > > > > > Or
> > > > > > > > is
> > > > > > > > this
> > > > > > > > another issue?
> > > > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> >
> >
> >
> >