I have a MultiBranch Pipeline based off a Jenkins file which explicitly clones another repository provided by parameters. I'm seeing that the it is freezing, and timing out, after attempting to ask for credentials for git-lfs
as part of git checkout -f <HASH>
command.
How can I checkout a repository with credentialed git lfs access?
Jenkinsfile:
stages {
stage('Fetch Source Code') {
steps{
dir('repo') {
git branch: "${params.Branch}", credentialsId: 'git-creds', url: "${params.RepoURL}"
}
}
}
Jenkins console:
> git init /home/jenkins/agent/workspace/<PIPELINE_NAME>/repo # timeout=10
Fetching upstream changes from <HTTPS_PRIVATE_GITLAB_URL>
> git --version # timeout=10
> git --version # 'git version 2.30.2'
using GIT_ASKPASS to set credentials Credentials to access git resources
> git fetch --tags --force --progress -- <HTTPS_PRIVATE_GITLAB_URL> +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
Checking out Revision HASH (refs/remotes/origin/master)
> git config remote.origin.url <HTTPS_PRIVATE_GITLAB_URL> # timeout=10
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f <HASH> # timeout=10
Times out