Jenkins GitBlit integration - jenkins

I am performing POC for my company using Jenkins, GitBlit integration.
I have installed GitBlit & Jenkins and followed below steps
Installed Jenkins & GitBlit
used authority.cmd for generating self signed certificate for using my ip address
created a ruby cucumber project in gitblit
in the edit -> receive selection of GitBlit repository added jenkins for pre-receive scripts
in the gitblit-1.7.1\data\groovy i have added my jenkins which is again hosted on localhost
here are my urls
Jenkins :- http://localhost:8080/
GitBlit :- https://--.--.---.100:8443
GitBlit repo url :- https://--.--.---.100:8443/r/testGit.git
in jenkins, i have created freestyle project
in the source code management added repo url
i am facing issue here jenkins is not able to connect and below is the error message and screenshot
Failed to connect to repository : Command "git.exe -c core.askpass=true ls- remote -h https://--.--.---.100:8443/r/testGit.git HEAD" returned status code 128:
stdout:
stderr: fatal: unable to access 'https://--.--.---.100:8443/r/testGit.git/': SSL certificate problem: self signed certificate in certificate chain

Your choices are...
Switch to http:// rather than https://
Switch to ssh:// rather than https://
Switch to git:// rather than https://
Purchase a signed SSL certificate
Instruct Jenkins Git to not verify certificates

Related

Failed to connect to repository : Command “git.exe ls-remote -h –

I’m getting error in configuring connection between Jenkins and GitLab.
I created Access Token in my GitLab remote repository and added it in Jenkins as Credential (Manage Jenkins > Manage Credentials > System > Add Credentials) but still connection between Jenkins and GitLab fails and brings error as attached screenshot shows.
I’m using Windows.

Jenkins on Linux Server Behind VPN Not Connecting to GitHub Webhook

I'm setting up continuous integration of a GitHub repository to automatically be pulled down by Jenkins onto a Linux server that is behind my company VPN that I do not control.
I have setup an Private SSH Key as both Jenkins Credentials and GitHub Deploy Key. I keep getting authenticating errors when Jenkins tries to connect to the SSH Repository URL. Is the VPN causing GitHub to not be able to POST to the server? Or am I missing something else?
ERROR MESSAGE:
Failed to connect to repository : Command "git ls-remote -h git#github.com:MyOrganization/MyRepository.git HEAD" returned status code 128:
stdout:
stderr: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Jenkins: Git Failed to connect to repository, returned status code 128

I'm attempting to clone a remote GitHub enterprise repository and am running into the following error after adding my remote repo's URL to the Git Plugin in my Jenkins configuration:
Failed to connect to repository : Command "git.exe ls-remote -h https://<<server>>/M/AS.git HEAD" returned status code 128:
stdout:
stderr: fatal: unable to access 'https://<<server>>/M/AS.git/': Received HTTP code 502 from proxy after CONNECT
Firs of all You Need to setup github with jenkins in below section also
Go to Github --> click on profile dropdown --> settings --> devloper settings --> personal access token -->
generate new token --> select all scopes --> copy the token
Then go to Jenkins --> manage Jenkins --> github settings --> add user --> Select secret text--> paste the token
Then Test the git-hub connection by clicking test button If its Successful the Jenkins will ready to clone the GitHub repository
And also add Webhooks, Integrations & Services in GitHub
Make sure you have generated Git API Token in Git repository and added the same in the Jenkins Credentials.
If the is done, I don't think there will be any issue in connecting Git to Jenkins.
Also you can test if your Git server is able to ping your Jenkins server. (If you are running your own Git and Jenkins).
All the best.
Check your failed job environment variables.
If there is no environment variable named NO_PROXY, set one in the configuration of your JENKINS job:
NO_PROXY=.mycompany.com
Here, I assume your GitHub Enterprise has an URL like myserver.mycompany.com (replace (mycompany.com by your own)
That will avoid Jenkins trying to access the remote server through the proxy.
If you are running from a VM, make sure you install the package 'git-core'.
You must have git installed in the machine where jenkins is running
I had the same issue and for me it helped a restart for the machine where it was installed Jenkins.

Issue when cloning project from gitlab repository into Jenkins?

Im new on jenkins technologie.
I started with creating a jenkins job that pull code from gitlab to jenkins. this job did not worked as I had an issue tells that jenkins does not trusted the self signed certificate used by the gitlab server
issue in screenshot
Can I did some configuration from the jenkins inetrface (from web site) to allow cloning the self signed certificate.
Any help is really appreciated.
Thank you
Caution: To be used only by understanding the security issues that will crop-up by this behaviour.
My company is hosting github enterprise with a custom certificate and hence faced similar situation. Following is the work-around I've done to mitigate the issue.
Login to jenkins server as jenkins user (I've used sudo su jenkins to do this in my case).
Add the following lines to ~/.gitconfig and save.
[http]
sslVerify = false
Restart jenkins server.
From the image you haven't specified any credentials when trying to access your repo generally you would mention some form of credentials
apart from that your computer doesn't trust the certificate from gitlab you have to add the certificate into your git(installed location)
This link will give you a detailed explaination :)
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

Configuring Jenkins with Cloud TFS (Supports GIT)

We are trying to configure Cloud TFS (Project Created with Git Support) & Jenkins (Ubuntu Machine).
When ever i try to enter the Repository URL it gives the following error.
Failed to connect to repository : Command "git ls-remote -h
https://xyz.visualstudio.com/DefaultCollection/_git/xyzrepo.git HEAD"
returned status code 128: stdout: stderr: fatal: Authentication
failed
I have generated keys using SSH route, but unfortunately i can't add the key # Cloud TFS Repo.
I have even tried this format https://USERNAME:PASSWORD#example.visualstudio.com/DefaultCollection/_git/Repo_Name but somehow was not successful.
PS: Bare minimum's are installed (GIT & Git plugin for Jenkins)
Any help/instructions is appreciated.
You probably need to enable Alternate Credentials in tfs.
Have a look at this howto

Resources