我有一个基于 Jenkins 文件的 MultiBranch Pipeline,它显式地克隆了由参数提供的另一个存储库。git-lfs
在尝试请求凭据作为命令的一部分后,我看到它正在冻结并超时git checkout -f <HASH>
。
如何签出具有凭据 git lfs 访问权限的存储库?
詹金斯文件:
stages {
stage('Fetch Source Code') {
steps{
dir('repo') {
git branch: "${params.Branch}", credentialsId: 'git-creds', url: "${params.RepoURL}"
}
}
}
詹金斯控制台:
> 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