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?