当存储库包含子模块时,Jenkins 无法签出管道脚本

当存储库包含子模块时,Jenkins 无法签出管道脚本

我有一个 Jenkins 多分支流水线作业,在添加子模块之前可以正常工作。现在已添加子模块,尝试从存储库中签出流水线脚本时,作业会挂起。

完整日志(最后一行是它挂起的地方):

Started by user [REDACTED]
 > git rev-parse --is-inside-work-tree # timeout=10
Setting origin to git@gitlab.[REDACTED].git
 > git config remote.origin.url git@gitlab.[REDACTED].git # timeout=10
Fetching origin...
Fetching upstream changes from origin
 > git --version # timeout=10
 > git config --get remote.origin.url # timeout=10
using GIT_SSH to set credentials [REDACTED]
 > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
Seen branch in repository origin/develop
Seen branch in repository origin/production
Seen branch in repository origin/staging
Seen 3 remote branches
Obtained Jenkins/WebGL from 72dd1dcad47cd4dd28110ac21e32c01dc93c86bc
Running in Durability level: PERFORMANCE_OPTIMIZED
[Pipeline] Start of Pipeline
[Pipeline] node
Running on ci-slave8 in /data/jenkins/workspace/[REDACTED]
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
using credential c442fbdc-7eb4-4a2b-b3f2-bdad07e4cb5b
Cloning the remote Git repository
Using shallow clone
Avoid fetching tags
Cloning repository git@gitlab.[REDACTED].git
 > git init /data/jenkins/workspace/[REDACTED] # timeout=10
Fetching upstream changes from git@gitlab.[REDACTED].git
 > git --version # timeout=10
using GIT_SSH to set credentials [REDACTED]
 > git fetch --no-tags --progress git@gitlab.[REDACTED].git +refs/heads/*:refs/remotes/origin/* --depth=1
 > git config remote.origin.url git@gitlab.[REDACTED].git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url git@gitlab.[REDACTED].git # timeout=10
Fetching upstream changes from git@gitlab.[REDACTED].git
using GIT_SSH to set credentials [REDACTED]
 > git fetch --no-tags --progress git@gitlab.[REDACTED].git +refs/heads/*:refs/remotes/origin/* --depth=1
Checking out Revision 72dd1dcad47cd4dd28110ac21e32c01dc93c86bc (develop)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 72dd1dcad47cd4dd28110ac21e32c01dc93c86bc

这里有一个作业配置的屏幕截图

另外,在发生挂起时检查构建机器时,我发现终端是提示输入密码

据我了解,第一个屏幕截图中指定的凭据是检查管道脚本时应该使用的。

子模块是否有特殊技巧?还是我配置不正确?

相关内容