I'm lost in trying to use a private git repository

37 views
Skip to first unread message

gary oblock

unread,
Jan 31, 2020, 5:30:49 PM1/31/20
to Jenkins Users
Please bear with me. I'd do a search for this information but frankly I
don't know enough about Jenkins & GIT to come up with a meaningful
query.

I'm trying to create a set of scripts shared between myself and a Government customer.
They'll be invoking them on a super computer and I'll be invoking them on Thunder2X
server via Jenkins.

So I've managed to create a private repository which I'll call for the sake of this
posting.


I've managed to but a test script on it and hand it public ssh key. It all
works fine and dandy from my desktop Linux box but here's the
grief I run into on Jenkins:

I cloned an existing build then started modifying the Source Code Management
stuff (under the advice of somebody else that doesn't really know this part of
Jenkins.) When I clicked the GIT button and entered


in the Repository URL field I got this:

Failed to connect to repository : Command "/usr/bin/git ls-remote -h https://github.com/usergary/scripts.git HEAD" returned status code 128:
stdout:
stderr: remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/usergary/scripts.git/'

All I want to do is associated the private ssh key with my invocation of this Jenkins build
so I can run the following in the execute shell:



What stupid things have I done wrong in my ignorance and what should I be doing instead?

Many thanks,

Gary Oblock

Mark Waite

unread,
Jan 31, 2020, 5:36:03 PM1/31/20
to Jenkins Users
Jenkins uses credentials to access private repositories.  You'll need to provide the credentials for that repository as a Jenkins credential.

The Jenkins git plugin supports username / password credentials for https repositories.

The Jenkins git plugin supports private key credentials for ssh repositories.

The sample repository syntax you provided is an https repository.  You'll need to provide a username / password credential, not a private key credential.

Mark Waite

gary oblock

unread,
Jan 31, 2020, 7:34:41 PM1/31/20
to Jenkins Users
Any pointers on how to do these??? Note, URLs of pages with generic help on these topics might suffice....
I'm a newbie to both Jenkins and GIT (though user howto documentation on the later seems more accessible.)

Thanks,

Gary

Mark Waite

unread,
Jan 31, 2020, 11:20:48 PM1/31/20
to Jenkins Users
On Sat, Feb 1, 2020 at 1:34 AM gary oblock <goblo...@gmail.com> wrote:
Any pointers on how to do these??? Note, URLs of pages with generic help on these topics might suffice....
I'm a newbie to both Jenkins and GIT (though user howto documentation on the later seems more accessible.)

Thanks,

Gary

On Friday, January 31, 2020 at 2:36:03 PM UTC-8, Mark Waite wrote:
Jenkins uses credentials to access private repositories.  You'll need to provide the credentials for that repository as a Jenkins credential.


Using credentials describes how to create credentials, including both username / password credentials and private key credentials.

Jenkins Minute - Creating your first pipeline describes how to create a Jenkins Pipeline job.

The Jenkins tutorials describe how to create jobs to support:

CloudBees provides a free self-paced training course, Pipeline Fundamentals, which includes a lab that uses ssh to create a Pipeline job with ssh in a Gitea repository using Blue Ocean.

Mark Waite
 
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/47d3e0f5-7909-44d5-abc5-9e68ddbbb9a3%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages