詹金斯管道有"多个候选修订",并正在挑选旧的

Fra*_*ger 8 git continuous-integration continuous-deployment jenkins jenkins-plugins

我配置了Jenkins multibranch Pipeline,它应该从远程GIT存储库获取源代码以进行构建.Jenkins似乎没有"随机"选择构建的旧提交,并在构建日志文件中显示"多个候选修订"消息.

我的管道看起来像:

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"]]
        ]
    )
Run Code Online (Sandbox Code Playgroud)

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
Run Code Online (Sandbox Code Playgroud)

在日志文件中,我可以看到Jenkins正在使用版本/0.0.1中的旧版本301c954e576bd3f03ef787563f159d541cb6e8d2而不是refs/remotes/origin/release/0.0.1中的新远程版本88be7349bd7b6ddb0654325e6b07cf1da2f8a35b.

有什么想法在这里出错吗?

小智 5

我不是 git 大师,但尝试指定

分支:[[名称:“*/release/0.0.1”]],

代替

分支:[[名称:“发布/0.0.1”]],