I am trying to create a Maven project in Jenkins. The code is in Git repository which uses non standard port 1754.
The port details are already there in the config file but the git plugin in jenkins is not able to connect. It is giving error for port 22.
Following error is coming in Jenkins (Git section) after adding following url: [email protected]:AutomationCode
Failed to connect to repository : Command "/usr/bin/git -c
core.askpass=true ls-remote -h [email protected]:AutomationCode
HEAD" returned status code 128:
stdout:
stderr: ssh: connect to host 10.115.2.110 port 22: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
When I cloned the git repository directly from terminal it is working fine but in Jenkins it is not using the config file for port.
I tried giving ssh URL but it is also not working. "Connection refused" error
is coming.
I tried giving fixed port number in Manage Jenkins -> configure system page in SSH Server
section. But still issue is unresolved.
Is there any way by which we can configure a project to use specific port in Jenkins -> Git or maybe access the .ssh/config file to take the port number ?
I am using SSH Keys to access the git.
If you are cloning from the command line using the same url ([email protected]:AutomationCode
), then:
Host gitolite
" entry.Make your Jenkins jobs print 'env
' to see if the environment variable (and username) are the same as the ones you would see in your terminal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With