4

I've been going round in circles for the past day attempting to get this working. I have found numerous instructions on how I might set this up but haven't progressed that far...

  • I have no previous experience with Git and I think many of these guides make an assumption that you have some basic understanding of Git
  • Many Windows specific guides talk about Jenkins running as the system user - that isn't the case for me, I just dropped the WAR into Tomcat and started it up

What I have done:

  • I have installed the Git Jenkins plugin (and upgraded some of its plugin dependencies).
  • I have started following the 'instructions' on the plugin's page (and got highly confused and feel that possibly some steps are irrelevant for me)
  • Started following the steps described here - I fall over fairly soon when it asks me to set my Jenkins path to cmd/git.cmd (I only have a cmd/git.exe in that directory). Nevertheless I struggle on, until it starts talking about SSH keys and the system user, well I don't have an issue with users I don't think.
  • I did take a look at Git password caching (described here), but the cached credentials still timeout which isn't ideal for the Jenkins user.
  • I tried to get up to speed with Git and it's access protocols using this guide.

Current errors:

Given that I have no username or password yet configured, it comes as no surprise that with my Git configured Jenkins job throws the following error:

Cloning repository https://git.company.local/scm/project.git
git --version
git version 1.8.4.msysgit.0
ERROR: Error cloning remote repo 'origin' : Could not clone https://git.company.local/scm/project.git
hudson.plugins.git.GitException: Could not clone https://git.company.local/scm/project.git
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:285)
    ...
Caused by: hudson.plugins.git.GitException: Failed to connect to https://git.company.local/scm/project.git (status = 401)
    ...
    ... 16 more
Trying next repository
ERROR: Could not clone repository
java.io.IOException: Could not clone

What I want to achieve:

I have a Git repository in Stash using a https protocol. I don't believe it is currently setup for SSH. I had assumed I could just enter the username and password in the Jenkins' job configuration and be done with it, just like other SCM configuraiton sections, but no.

I do not want my Jenkins' Git password stored in plain text in the job's configuration section i.e. in the URL.

What am I supposed to do?

Community
  • 1
  • 1
Ed .
  • 6,373
  • 8
  • 62
  • 82
  • You don't want your Jenkins's git credentials in plain text? That is why I wrote http://stackoverflow.com/a/18362082/6309 ;) – VonC Oct 15 '13 at 14:35
  • 1
    Long question, but isn't this a duplicate of [this question](http://stackoverflow.com/questions/3363606/hudson-git-https-password-how-do-i-specify-it), with the addition of answer to use encryption provided by VonC. So, if you don't want to use something showing in the job config, use _netrc or encryption as explained by VonC. – eis Oct 15 '13 at 14:42
  • Also, if cache expiry is your only problem with credential helper, you should probably just use `git config credential.helper store` which was already explained in the thread you linked to. That doesn't expire. – eis Oct 15 '13 at 14:51

0 Answers0