Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Jenkins to connect to git repository

I'm having trouble getting Jenkins to recognize my git repo. The screenshot is below. I was told using git clone https://blah/blah.git will clone the repo as read-only w/o needing credentials or keys. I want to just pull the code and build it.

The funny thing is when I execute the same command from the command line, it works and files get pulled down from the repo.

export GIT_SSL_NO_VERIFY=true
git clone https://blah.com:8443/blah.git

When I enter the url and environment variable in Jenkins, it's says it can't connect to the repository. Does anyone know what I might need to do to get it to work? Thanks in advance for your help.

enter image description here

UPDATE/CLARIFICATION: The Jenkins install is under a service account, not related to any user within the company.

UPDATE#2: Here's the console output. I've sanitized it a little so i apologize if i missed something.

Started by user anonymous
Building in workspace /home/hduser/.jenkins/workspace/analytics
Fetching changes from the remote Git repository
Fetching upstream changes from https://blah.com:8443/blah.git
FATAL: Failed to fetch from https://blah.com:8443/blah.gitt
hudson.plugins.git.GitException: Failed to fetch from https://blah.com:8443/blah.git
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:612)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:836)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)    
    at hudson.model.Run.execute(Run.java:1665)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:246)
Caused by: hudson.plugins.git.GitException: Failed to connect to https://blah.com:8443/blah.git
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1391)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:167)
    at hudson.plugins.git.GitAPI.fetch(GitAPI.java:229)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:610)
    ... 10 more
like image 675
Classified Avatar asked Nov 01 '13 20:11

Classified


1 Answers

Thanks for everyone's suggestions, comments, and help. I think this is a plugin issue. Someone else experienced the same thing I did (original post here). If I run this command from the command line or if I enter the command in Jenkins as Build>Execute shell>Command, it works fine.

I have Git Client plugin = 1.4.3 and Git Plugin 1.5.0. I'll wait to see if a newer plugin fixes this.

like image 190
Classified Avatar answered Sep 23 '22 01:09

Classified