I am new with Jenkins and trying to create a pipeline and checkout the private BitBucket repository from Jenkins and then install dependencies and then create build.
But I am having issue in the first step while checkout the repository branch.
I have set the credentials and SSH link as well.
Here is the Error:
The recommended git tool is: NONE
using credential 02cb4299-3a20-424f-a541-1771e5b2e0b9
C:\Users\ahsan.alam\AppData\Local\Programs\Git\bin\git.exe rev-parse --resolve-git-dir C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\SCM-Pipline\.git # timeout=10
Fetching changes from the remote Git repository
C:\Users\ahsan.alam\AppData\Local\Programs\Git\bin\git.exe config remote.origin.url ssh:///git@bitbucket.org:Arsalanakhtar123/etisalat-jenkins.git/ # timeout=10
Fetching upstream changes from ssh:///git@bitbucket.org:Arsalanakhtar123/etisalat-jenkins.git/
C:\Users\ahsan.alam\AppData\Local\Programs\Git\bin\git.exe --version # timeout=10
git --version # 'git version 2.37.0.windows.1'
C:\Users\ahsan.alam\AppData\Local\Programs\Git\bin\git.exe fetch --tags --force --progress -- ssh:///git@bitbucket.org:Arsalanakhtar123/etisalat-jenkins.git/ +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
Here is the code:
pipeline {
agent any
stages {
stage('Git Checkout') {
steps {
git branch: 'master',
credentialsId: '<credentialIdsHere>', // changed
url: 'ssh://git@bitbucket.org:company/repo.git/' // changed
}
}
}
}
Also I have specify the git.exe path
Assuming SSH is working, meaning you can execute manually a git ls-remote
(for instance) to that SSH URL, I would recommend the syntax (for said SSH URL):
ssh://git@bitbucket.org/company/repo.git
^^^ (/, not :)
# or
git@bitbucket.org:company/repo.git/
^^^ (OK, but no ssh:// prefix)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.