Quantcast

Specifying user name and password for svn repo in Job configuration.

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Specifying user name and password for svn repo in Job configuration.

Ramith Jayasinghe
Hi Guys,
 I trying to figure out how to pass credentials (user name and password) for svn repository in the job configuration xml.
I checked the code base [1] and this feature ( per job credential) seems to be available.
So has anyone tried this before? 
Could someone share a sample Xml fragment to do this?


[1] PerJobCredentialStore.java

Regards
Ramith (LSF)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Specifying user name and password for svn repo in Job configuration.

Ramith Jayasinghe
HI,
After playing around with jenkins UI, I found that the form located in [1] allows user to enter a authentication mechanism and other relevant information for the svn repository. So If I do the same by POSTing
correct parameters programmatically  (i.e. HttpClient) it would solve my problem right?
Or is there any other (/more elegent) way of doing this? 
Or is it possible to send this information along with job configuration xml ?


[1] http://<JENKINS_SERVER>/job/<JOB_NAME>/descriptorByName/hudson.scm.SubversionSCM/enterCredential?<SVN_REPO_URL>


Regards
Ramith (LSF)




On Monday, August 27, 2012 2:03:10 PM UTC+5:30, Ramith Jayasinghe wrote:
Hi Guys,
 I trying to figure out how to pass credentials (user name and password) for svn repository in the job configuration xml.
I checked the code base [1] and this feature ( per job credential) seems to be available.
So has anyone tried this before? 
Could someone share a sample Xml fragment to do this?


[1] PerJobCredentialStore.java

Regards
Ramith (LSF)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Specifying user name and password for svn repo in Job configuration.

Ramith Jayasinghe
In reply to this post by Ramith Jayasinghe
Hi,
 After playing around with jenkins UI, I figured out that form located at [1] allows user to specify svn credentials per job.
 Would it be a good/elegant idea to emulate this (by POSTING correct data to relevant url) programmatically to get this done? 
is there any other way such as specifying the configuration within the job configuration XML?

[1] http://<JENKINS_URL>/job/<JOB_NAME>/descriptorByName/hudson.scm.SubversionSCM/enterCredential?<SVN_REPO>

Regards
Ramith (LSF)

On Monday, August 27, 2012 2:03:10 PM UTC+5:30, Ramith Jayasinghe wrote:
Hi Guys,
 I trying to figure out how to pass credentials (user name and password) for svn repository in the job configuration xml.
I checked the code base [1] and this feature ( per job credential) seems to be available.
So has anyone tried this before? 
Could someone share a sample Xml fragment to do this?


[1] PerJobCredentialStore.java

Regards
Ramith (LSF)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Specifying user name and password for svn repo in Job configuration.

Qazwart-2
In reply to this post by Ramith Jayasinghe
Jenkins can store subversion credentials per job, or under the $HOME.subversion/auth directory.

If you need a different credential for a specific job, go to that job's configuration. Click on the help button by where you enter the Subversion URL. Read the help. There's a link that will allow you to enter a different credential.

--
David Weintraub
[hidden email]

On Aug 27, 2012, at 4:33 AM, Ramith Jayasinghe <[hidden email]> wrote:

> Hi Guys,
>  I trying to figure out how to pass credentials (user name and password) for svn repository in the job configuration xml.
> I checked the code base [1] and this feature ( per job credential) seems to be available.
> So has anyone tried this before?
> Could someone share a sample Xml fragment to do this?
>
>
> [1] PerJobCredentialStore.java
>
> Regards
> Ramith (LSF)
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Specifying user name and password for svn repo in Job configuration.

Ramith Jayasinghe
Hi David,
Thanks for the reply.
When someone enter SVN credentials in the screen [1] you mentioned
that will end up in [2].
Correct me if I'm wrong, but as far as I understood anything that's
stored there will be
for entire Jenkins (not exactly per job).

However, by playing around with jenkins for a while I figured out that
screen available at [3] actually allows User
to set credentials for a specific job ( credentials given will be
stored in job directory).
However, I'm looking for a elegant way of doing this programmatically.

So far what I have managed is to do a HTTP POST to [4] with relevant
parameters and check for HTTP response (and Location header) for
success. So what do u guys think? would this be a clean approach ?


[1] http://<JENKINS_SERVER>/scm/SubversionSCM/enterCredential
[2] <JENKINS_HOME>/hudson.scm.SubversionSCM.xml
[3] <JENKINS_SERVER>/job/<JOB_NAME>/descriptorByName/hudson.scm.SubversionSCM/enterCredential
[4]  <JENKINS_SERVER>/job/<JOB_NAME>/descriptorByName/hudson.scm.SubversionSCM/postCredential

Regards
Ramith (LSF)

On Mon, Aug 27, 2012 at 7:20 PM, Qazwart <[hidden email]> wrote:

> Jenkins can store subversion credentials per job, or under the $HOME.subversion/auth directory.
>
> If you need a different credential for a specific job, go to that job's configuration. Click on the help button by where you enter the Subversion URL. Read the help. There's a link that will allow you to enter a different credential.
>
> --
> David Weintraub
> [hidden email]
>
> On Aug 27, 2012, at 4:33 AM, Ramith Jayasinghe <[hidden email]> wrote:
>
>> Hi Guys,
>>  I trying to figure out how to pass credentials (user name and password) for svn repository in the job configuration xml.
>> I checked the code base [1] and this feature ( per job credential) seems to be available.
>> So has anyone tried this before?
>> Could someone share a sample Xml fragment to do this?
>>
>>
>> [1] PerJobCredentialStore.java
>>
>> Regards
>> Ramith (LSF)
>>



--
Ɣampire Łestat™
[Coolest Guy on Earth™]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Specifying user name and password for svn repo in Job configuration.

Ramith Jayasinghe
Hi Folks,
 Any Ideas on this ? ;)

Regads
Ramith (LSF)


On Mon, Aug 27, 2012 at 8:47 PM, Яamith (tm) <[hidden email]> wrote:

> Hi David,
> Thanks for the reply.
> When someone enter SVN credentials in the screen [1] you mentioned
> that will end up in [2].
> Correct me if I'm wrong, but as far as I understood anything that's
> stored there will be
> for entire Jenkins (not exactly per job).
>
> However, by playing around with jenkins for a while I figured out that
> screen available at [3] actually allows User
> to set credentials for a specific job ( credentials given will be
> stored in job directory).
> However, I'm looking for a elegant way of doing this programmatically.
>
> So far what I have managed is to do a HTTP POST to [4] with relevant
> parameters and check for HTTP response (and Location header) for
> success. So what do u guys think? would this be a clean approach ?
>
>
> [1] http://<JENKINS_SERVER>/scm/SubversionSCM/enterCredential
> [2] <JENKINS_HOME>/hudson.scm.SubversionSCM.xml
> [3] <JENKINS_SERVER>/job/<JOB_NAME>/descriptorByName/hudson.scm.SubversionSCM/enterCredential
> [4]  <JENKINS_SERVER>/job/<JOB_NAME>/descriptorByName/hudson.scm.SubversionSCM/postCredential
>
> Regards
> Ramith (LSF)
>
> On Mon, Aug 27, 2012 at 7:20 PM, Qazwart <[hidden email]> wrote:
>> Jenkins can store subversion credentials per job, or under the $HOME.subversion/auth directory.
>>
>> If you need a different credential for a specific job, go to that job's configuration. Click on the help button by where you enter the Subversion URL. Read the help. There's a link that will allow you to enter a different credential.
>>
>> --
>> David Weintraub
>> [hidden email]
>>
>> On Aug 27, 2012, at 4:33 AM, Ramith Jayasinghe <[hidden email]> wrote:
>>
>>> Hi Guys,
>>>  I trying to figure out how to pass credentials (user name and password) for svn repository in the job configuration xml.
>>> I checked the code base [1] and this feature ( per job credential) seems to be available.
>>> So has anyone tried this before?
>>> Could someone share a sample Xml fragment to do this?
>>>
>>>
>>> [1] PerJobCredentialStore.java
>>>
>>> Regards
>>> Ramith (LSF)
>>>
>
>
>
> --
> Ɣampire Łestat™
> [Coolest Guy on Earth™]



--
Ɣampire Łestat™
[Coolest Guy on Earth™]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Specifying user name and password for svn repo in Job configuration.

Qazwart-2
On Tue, Aug 28, 2012 at 7:33 AM, Яamith (tm) <[hidden email]> wrote:
>  Any Ideas on this ? ;)

Looking at my setup, it appears that each job has it's own set of
credentials. There's a file called "subversion.credentials" under each
job.

I know that Jenkins will use the Subversion credentials listed under
the $HOME/.subversion/auth if found, so you might want to verify that
file isn't set. I believe Jenkins will use the local job credentials
before trying the global ones.

--
David Weintraub
[hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Specifying user name and password for svn repo in Job configuration.

Les Mikesell
On Tue, Aug 28, 2012 at 11:35 AM, David Weintraub <[hidden email]> wrote:

> On Tue, Aug 28, 2012 at 7:33 AM, Яamith (tm) <[hidden email]> wrote:
>>  Any Ideas on this ? ;)
>
> Looking at my setup, it appears that each job has it's own set of
> credentials. There's a file called "subversion.credentials" under each
> job.
>
> I know that Jenkins will use the Subversion credentials listed under
> the $HOME/.subversion/auth if found, so you might want to verify that
> file isn't set. I believe Jenkins will use the local job credentials
> before trying the global ones.

I think jenkins tries existing global credentials when someone creates
a new job and if they work for the new url, it does not present the
form for adding new credentials and stores the global ones for the
job.   At least the ones I've checked are wrong for most of the people
who would have created the jobs...   Does anyone have a handy way to
fix this?

--
   Les Mikesell
     [hidden email]
Loading...