【发布时间】:2018-09-26 14:55:15
【问题描述】:
我配置了一个 Jenkins 多分支管道,它应该从远程 GIT 存储库获取源以进行构建。 Jenkins no 似乎“随机”为构建选择一个旧提交,并在构建日志文件中显示消息“多个候选修订”。
我的管道看起来像:
checkout(
[
$class: 'GitSCM',
branches: [[name: "release/0.0.1"]],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'MessageExclusion', excludedMessage: '(?s)^\\[DOC\\] Robot.*']
],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'xxx', url: "https://somerepo.net/scm/someproject/somecomponent.git"]]
]
)
来自 Jenkins 的日志文件显示:
[Pipeline] checkout
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://somerepo.net/scm/someproject/somecomponent.git # timeout=10
Fetching upstream changes from https://somerepo.net/scm/someproject/somecomponent.git
> git --version # timeout=10
using GIT_ASKPASS to set credentials
> git fetch --tags --progress https://somerepo.net/scm/someproject/somecomponent.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse release/0.0.1^{commit} # timeout=10
> git rev-parse refs/remotes/origin/release/0.0.1^{commit} # timeout=10
Multiple candidate revisions
Checking out Revision 301c954e576bd3f03ef787563f159d541cb6e8d2 (release/0.0.1)
> git config core.sparsecheckout # timeout=10
> git checkout -f 301c954e576bd3f03ef787563f159d541cb6e8d2
Commit message: "Some old commit message"
> git rev-list --no-walk 88be7349bd7b6ddb0654325e6b07cf1da2f8a35b # timeout=10
在日志文件中,我可以看到 Jenkins 正在使用来自 release/0.0.1 的旧版本 301c954e576bd3f03ef787563f159d541cb6e8d2 而不是来自 refs/remotes/origin/release./0.0 的新远程 88be7349bd7b6ddb0654325e6b07cf1da2f8a35b。
任何想法这里出了什么问题?
【问题讨论】:
标签: git jenkins continuous-integration jenkins-plugins continuous-deployment