rpm command with TeamCity 2.1

Hi,

Since TeamCity 2.1, you must add authentication info in URLs when using 'wget' to retrieve build artifacts.

e.g. If the target URL is:
http://myserver.com:8111/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm
then this syntax works with wget:
wget "http://\:@myserver.com:8111/httpAuth/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm" But, this syntax does not work for the "rpm" command. I've tried the following but they don't work: rpm -ivh "http://\:@myserver.com:8111/httpAuth/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm" and rpm -ivh "http://%5C:]]>@myserver.com:8111/httpAuth/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm"

Each time I try the above rpm commands I get: transfer failed - Unknown or unexpected error

It was possible to use a web location with "rpm" with TeamCity 2.0. Is there a way to do it with TeamCity 2.1 or is there a way to turn authentication for artifacts access?

Thanks,
-Dave

12 comments

Hello Dave,

Looks like RPM does not support HTTP authentication. At least it does not
send authentication headers when username and password are specified in the
URL. You can try to enable guest login and download RPM file by URL with
guest=1 parameter. If guest login is enabled and parameter guest=1 presents
in the URL TeamCity should not ask for authentication.

--
Pavel Sher


"Dave Leskovac" <no_reply@jetbrains.com> wrote in message
news:9164823.1181854070327.JavaMail.itn@is.intellij.net...

Hi,

>

Since TeamCity 2.1, you must add authentication info in URLs when using
'wget' to retrieve build artifacts.

>

e.g. If the target URL is:
http://myserver.com:8111/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm
then this syntax works with wget:
wget
"http://<domain>\<user>:<password>@myserver.com:8111/httpAuth/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm"

>

But, this syntax does not work for the "rpm" command. I've tried the
following but they don't work:
rpm -ivh
"http://<domain>\<user>:<password>@myserver.com:8111/httpAuth/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm"
and
rpm -ivh
"http://<domain>%5C<user>:<password>@myserver.com:8111/httpAuth/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm"

>

Each time I try the above rpm commands I get: transfer failed - Unknown or
unexpected error

>

It was possible to use a web location with "rpm" with TeamCity 2.0. Is
there a way to do it with TeamCity 2.1 or is there a way to turn
authentication for artifacts access?

>

Thanks,
-Dave



0

Pavel,

You can try to enable guest login and download RPM file by URL with
guest=1 parameter. If guest login is enabled and parameter guest=1 presents
in the URL TeamCity should not ask for authentication.


Guest authentication was already enabled. I should add that I am using LDAP
authentication in TeamCity.

Using 'wget' to retrieve a TeamCity artifact using the syntax I wrote in the
original msg or this, for example, does work:
wget "http://myserver.com:8111/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm?guest=1" -O myrpm-1.0-110.noarch.rpm

But when I try this:
rpm -ivh http://myserver.com:8111/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm?guest=1"

I get:
error: File not found by glob: http://myserver.com:8111/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm?guest=1
D: found 0 source and 0 binary packages

Other than reverting back to TeamCity 2.0, is there a way to turn off authentication of artifact access?

Thanks,
-Dave

0

Hello Dave,

Using 'wget' to retrieve a TeamCity artifact using the syntax I wrote in
the
original msg or this, for example, does work:
wget
"http://myserver.com:8111/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm?guest=1"
-O myrpm-1.0-110.noarch.rpm

>

But when I try this:
rpm -ivh
http://myserver.com:8111/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm?guest=1"

>

I get:
error: File not found by glob:
http://myserver.com:8111/repository/download/bt52/2973:id/myrpm-1.0-110.noarch.rpm?guest=1
D: found 0 source and 0 binary packages
Other than reverting back to TeamCity 2.0, is there a way to turn off
authentication of artifact access?


Looks like rpm treats ? character in the URL as file system glob character.
Maybe you can download this file using wget and then install it with RPM?
Why not use two commands?

--
Pavel Sher


0

Looks like rpm treats ? character in the URL as file system glob character.
Maybe you can download this file using wget and then install it with RPM?
Why not use two commands?


This is considered an unacceptable solution here. Is the only solution to running the rpm
command with http to roll back to TeamCity 2.0?

-Dave

0

Dave,

According to this bug report
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=143885 problem with ?
character in the URL is fixed in the RPM-4.4.8. Is it possible to upgrade
your RPM to this version?

--
Pavel Sher


"Dave Leskovac" <no_reply@jetbrains.com> wrote in message
news:19826088.1181923484808.JavaMail.itn@is.intellij.net...
>> Looks like rpm treats ? character in the URL as file system glob
>> character.
>> Maybe you can download this file using wget and then install it with RPM?
>> Why not use two commands?
>

This is considered an unacceptable solution here. Is the only solution to
running the rpm
command with http to roll back to TeamCity 2.0?

>

-Dave



0

Dave,

Another possible solution is to write your own plugin which will process
your URLs and download any artifacts w/o authentication. If this is not
acceptable too, then you probably should downgrade to TeamCity 2.0. In the
future version we can implement a property which will disable authentication
for TeamCity artifacts repository. Chances are we will release version 2.1.1
or something like this soon and this change could be integrated there.

--
Pavel Sher

"Pavel Sher" <pavel.sher@jetbrains.com> wrote in message
news:f4ufqk$nnn$1@is.intellij.net...

Dave,

>

According to this bug report
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=143885 problem with ?
character in the URL is fixed in the RPM-4.4.8. Is it possible to upgrade
your RPM to this version?

>

--
Pavel Sher

>
>

"Dave Leskovac" <no_reply@jetbrains.com> wrote in message
news:19826088.1181923484808.JavaMail.itn@is.intellij.net...

>>> Looks like rpm treats ? character in the URL as file system glob
>>> character.
>>> Maybe you can download this file using wget and then install it with
>>> RPM?
>>> Why not use two commands?
>>
>> This is considered an unacceptable solution here. Is the only solution to
>> running the rpm
>> command with http to roll back to TeamCity 2.0?
>>
>> -Dave
>



0

Hello Dave,

One possible workaround can be making .BuildServer/system/artifacts server directory available via HTTP or by other means.
Build artifacts can then be retrieved from //]]> subdirectory.

--
Best regards,

Yegor Yarko
Quality Assurance Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

According to this bug report
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1
43885 problem with ?
character in the URL is fixed in the RPM-4.4.8. Is it
possible to upgrade your RPM to this version?


That's interesting. I will see if I can find rpm-4.4.8 or above for all the distributions of Linux that we have.

-Dave

0

One possible workaround can be making
.BuildServer/system/artifacts server directory
available via HTTP or by other means.
Build artifacts can then be retrieved from <Project
Name>/<Build Configuration Name>/<BuildId> subdirectory.


I have already done this & it does work. I just don't like a solution
where I have to setup an apache alias to work outside of TeamCity
in order to do something that was possible in TeamCity previously.

I consider this a short-term solution and would be happy if the ability
to use the rpm command with http through TeamCity is restored in
some future TeamCity release.

Thanks,
-Dave

0

Pavel,

I like the idea about adding a property to disable authentication for artifacts.
Should I open a JIRA issue for this?

Thanks,
-Dave

0

Dave,

Please watch this issue: http://www.jetbrains.net/jira/browse/TW-2836

--
Pavel Sher

"Dave Leskovac" <no_reply@jetbrains.com> wrote in message
news:1455486.1181936286720.JavaMail.itn@is.intellij.net...

Pavel,

>

I like the idea about adding a property to disable authentication for
artifacts.
Should I open a JIRA issue for this?

>

Thanks,
-Dave



0

Please sign in to leave a comment.