我配置了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} # …Run Code Online (Sandbox Code Playgroud) git continuous-integration continuous-deployment jenkins jenkins-plugins